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