|
|
|
|
@ -272,7 +272,7 @@ class ShapeModel extends Listener {
|
|
|
|
|
this._label = +labelId;
|
|
|
|
|
this._importAttributes([], []);
|
|
|
|
|
this._setupKeyFrames();
|
|
|
|
|
this.notify('attributes');
|
|
|
|
|
this.notify('changelabel');
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
throw Error(`Unknown label id value found: ${labelId}`);
|
|
|
|
|
@ -1403,6 +1403,7 @@ class ShapeView extends Listener {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this._controller = shapeController;
|
|
|
|
|
this._updateReason = null;
|
|
|
|
|
|
|
|
|
|
this._shapeContextMenu = $('#shapeContextMenu');
|
|
|
|
|
this._pointContextMenu = $('#pointContextMenu');
|
|
|
|
|
@ -1426,7 +1427,7 @@ class ShapeView extends Listener {
|
|
|
|
|
this._flags.dragging = true;
|
|
|
|
|
blurAllElements();
|
|
|
|
|
this._hideShapeText();
|
|
|
|
|
this.notify();
|
|
|
|
|
this.notify('drag');
|
|
|
|
|
}).on('dragend', (e) => {
|
|
|
|
|
let p1 = e.detail.handler.startPoints.point;
|
|
|
|
|
let p2 = e.detail.p;
|
|
|
|
|
@ -1438,7 +1439,7 @@ class ShapeView extends Listener {
|
|
|
|
|
events.drag = null;
|
|
|
|
|
this._flags.dragging = false;
|
|
|
|
|
this._showShapeText();
|
|
|
|
|
this.notify();
|
|
|
|
|
this.notify('drag');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Setup resize events
|
|
|
|
|
@ -1456,7 +1457,7 @@ class ShapeView extends Listener {
|
|
|
|
|
events.resize = Logger.addContinuedEvent(Logger.EventType.resizeObject);
|
|
|
|
|
blurAllElements();
|
|
|
|
|
this._hideShapeText();
|
|
|
|
|
this.notify();
|
|
|
|
|
this.notify('resize');
|
|
|
|
|
}).on('resizing', () => {
|
|
|
|
|
objWasResized = true;
|
|
|
|
|
}).on('resizedone', () => {
|
|
|
|
|
@ -1469,7 +1470,7 @@ class ShapeView extends Listener {
|
|
|
|
|
events.resize = null;
|
|
|
|
|
this._flags.resizing = false;
|
|
|
|
|
this._showShapeText();
|
|
|
|
|
this.notify();
|
|
|
|
|
this.notify('resize');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2353,6 +2354,18 @@ class ShapeView extends Listener {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
notify(newReason) {
|
|
|
|
|
let oldReason = this._updateReason;
|
|
|
|
|
this._updateReason = newReason;
|
|
|
|
|
try {
|
|
|
|
|
Listener.prototype.notify.call(this);
|
|
|
|
|
}
|
|
|
|
|
finally {
|
|
|
|
|
this._updateReason = oldReason;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Inteface methods
|
|
|
|
|
draw(interpolation) {
|
|
|
|
|
let outside = interpolation.position.outside;
|
|
|
|
|
@ -2473,6 +2486,7 @@ class ShapeView extends Listener {
|
|
|
|
|
case 'remove':
|
|
|
|
|
if (model.removed) {
|
|
|
|
|
this.erase();
|
|
|
|
|
this.notify('remove');
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 'position':
|
|
|
|
|
@ -2494,6 +2508,7 @@ class ShapeView extends Listener {
|
|
|
|
|
if (colorByLabel.prop('checked')) {
|
|
|
|
|
colorByLabel.trigger('change');
|
|
|
|
|
}
|
|
|
|
|
this.notify('changelabel');
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 'attributeFocus': {
|
|
|
|
|
@ -2663,6 +2678,10 @@ class ShapeView extends Listener {
|
|
|
|
|
return this._flags.resizing;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get updateReason() {
|
|
|
|
|
return this._updateReason;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Used in shapeGrouper in order to get model via controller and set group id
|
|
|
|
|
controller() {
|
|
|
|
|
return this._controller;
|
|
|
|
|
|