|
@@ -489,13 +489,14 @@ export class SGraphItem extends SObject {
|
|
|
}
|
|
|
}
|
|
|
this.$emit("onMouseDown", event);
|
|
|
+ // 记录上一个 grabItem
|
|
|
+ if (this.scene) {
|
|
|
+ this._lastGrab = this.scene.grabItem;
|
|
|
+ }
|
|
|
// 移动
|
|
|
if (this.moveable) {
|
|
|
this._mouseDownPos = new SPoint(event.x, event.y);
|
|
|
this._isMoving = true;
|
|
|
- if (this.scene) {
|
|
|
- this._lastGrab = this.scene.grabItem;
|
|
|
- }
|
|
|
this.grabItem(this);
|
|
|
return true;
|
|
|
}
|
|
@@ -580,8 +581,10 @@ export class SGraphItem extends SObject {
|
|
|
}
|
|
|
|
|
|
this.$emit("onMouseUp", event);
|
|
|
- this._isMoving = false;
|
|
|
- this.releaseItem();
|
|
|
+ if (this._isMoving) {
|
|
|
+ this._isMoving = false;
|
|
|
+ this.releaseItem();
|
|
|
+ }
|
|
|
if (this.scene) {
|
|
|
this.scene.grabItem = this._lastGrab;
|
|
|
}
|