|
@@ -422,11 +422,6 @@ export class SGraphItem extends SObject {
|
|
|
console.log(e);
|
|
|
}
|
|
|
}
|
|
|
- // 选择
|
|
|
- let select = false;
|
|
|
- if (this.selectable) {
|
|
|
- select = this.clickSelect(event);
|
|
|
- }
|
|
|
// 移动
|
|
|
if (this.moveable) {
|
|
|
this._mouseDownPos = new SPoint(event.x, event.y);
|
|
@@ -437,7 +432,7 @@ export class SGraphItem extends SObject {
|
|
|
this.grabItem(this);
|
|
|
return true;
|
|
|
}
|
|
|
- return select;
|
|
|
+ return false;
|
|
|
} // Function onMouseDown()
|
|
|
|
|
|
/**
|
|
@@ -472,6 +467,14 @@ export class SGraphItem extends SObject {
|
|
|
event.y - this._mouseDownPos.y
|
|
|
);
|
|
|
this.moveTo(this.pos.x + mp.x, this.pos.y + mp.y);
|
|
|
+ if (this.scene && this.selected) {
|
|
|
+ // this.scene.selectContainer.itemList.indexOf(this)
|
|
|
+ this.scene.selectContainer.itemList.forEach(t => {
|
|
|
+ if (t != this) {
|
|
|
+ t.moveTo(t.pos.x + mp.x, t.pos.y + mp.y);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
this.$emit("onMove", old, this.pos);
|
|
|
}
|
|
|
|
|
@@ -509,12 +512,26 @@ export class SGraphItem extends SObject {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (this.scene && this.selected) {
|
|
|
+ // this.scene.selectContainer.itemList.indexOf(this)
|
|
|
+ this.scene.selectContainer.itemList.forEach(t => {
|
|
|
+ if (t != this) {
|
|
|
+ t.moveToOrigin(t.x, t.y);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 选择
|
|
|
+ let select = false;
|
|
|
+ if (this.selectable) {
|
|
|
+ select = this.clickSelect(event);
|
|
|
+ }
|
|
|
this._isMoving = false;
|
|
|
this.releaseItem();
|
|
|
if (this.scene) {
|
|
|
this.scene.grabItem = this._lastGrab;
|
|
|
}
|
|
|
- return false;
|
|
|
+ return select;
|
|
|
} // Function onMouseUp()
|
|
|
|
|
|
/**
|
|
@@ -704,7 +721,8 @@ export class SGraphItem extends SObject {
|
|
|
*/
|
|
|
private clickSelect(event: SMouseEvent): boolean {
|
|
|
// 如果Item不可被选中,或没有按下鼠标左键,则直接返回
|
|
|
- if (!this.selectable || event.buttons != SMouseButton.LeftButton) {
|
|
|
+ if (!this.selectable) {
|
|
|
+ // || event.buttons != SMouseButton.LeftButton
|
|
|
return false;
|
|
|
}
|
|
|
const scene = this.scene;
|