fix Transformer bugs

This commit is contained in:
Anton Lavrenov
2019-02-27 08:35:30 -05:00
parent 61a75477c6
commit a62ce96214
3 changed files with 106 additions and 1325 deletions

View File

@@ -30,8 +30,6 @@ var ATTR_CHANGE_LIST = [
var NODE_RECT = 'nodeRect';
var TRANSFORM_CHANGE_STR = [
'xChange.tr',
'yChange.tr',
'widthChange.tr',
'heightChange.tr',
'scaleXChange.tr',
@@ -197,15 +195,15 @@ export class Transformer extends Group {
.map(prop => prop + 'Change.tr')
.join(' ');
const upChange = () => {
const onChange = () => {
this._resetTransformCache();
if (!this._transforming) {
this.update();
}
};
node.on(additionalEvents, upChange);
node.on(TRANSFORM_CHANGE_STR, upChange);
node.on(additionalEvents, onChange);
node.on(TRANSFORM_CHANGE_STR, onChange);
node.on('xChange.tr yChange.tr', () => this._resetTransformCache());
// we may need it if we set node in initial props
// so elements are not defined yet
var elementsCreated = !!this.findOne('.top-left');