Refactoring property definition code
This commit is contained in:
@@ -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)
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user