Refactoring property definition code

This commit is contained in:
Jeff Avallone
2014-12-17 16:04:55 -05:00
parent a0f145ab3d
commit 17a95392a8
6 changed files with 79 additions and 64 deletions
+15 -13
View File
@@ -3,6 +3,21 @@ import Q from 'q';
export default {
type: 'charset',
definedProperties: {
_anchor: {
get: function() {
var box = this.container.getBBox(),
matrix = this.transform().localMatrix;
return {
ax: box.x,
ax2: box.x2,
ay: matrix.y(0, this.partContainer.getBBox().cy)
};
}
}
},
_render() {
this.partContainer = this.container.group();
@@ -29,18 +44,5 @@ export default {
return part.textValue;
}
});
Object.defineProperty(this, '_anchor', {
get: function() {
var box = this.container.getBBox(),
matrix = this.transform().localMatrix;
return {
ax: box.x,
ax2: box.x2,
ay: matrix.y(0, this.partContainer.getBBox().cy)
};
}
});
}
};