Converting getAnchor into a property

This commit is contained in:
Jeff Avallone
2014-12-17 15:24:27 -05:00
parent 155ad51d58
commit f93388dec0
5 changed files with 68 additions and 62 deletions
+14 -12
View File
@@ -20,18 +20,6 @@ export default {
});
},
_getAnchor() {
var box = this.container.getBBox(),
matrix = this.transform().localMatrix;
return {
atype: this.type,
ax: box.x,
ax2: box.x2,
ay: matrix.y(0, this.partContainer.getBBox().cy)
};
},
setup() {
this.invert = this.properties.invert !== '';
this.elements = _.unique(this.properties.parts.elements, part => {
@@ -41,5 +29,19 @@ export default {
return part.textValue;
}
});
Object.defineProperty(this, '_anchor', {
get: function() {
var box = this.container.getBBox(),
matrix = this.transform().localMatrix;
return {
atype: this.type,
ax: box.x,
ax2: box.x2,
ay: matrix.y(0, this.partContainer.getBBox().cy)
};
}
});
}
};