|
@@ -373,18 +373,19 @@ export class SGraphItem extends SObject {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ // 选择
|
|
|
|
+ let select = false;
|
|
if (this.selectable) {
|
|
if (this.selectable) {
|
|
- this.clickSelect(event);
|
|
|
|
|
|
+ select = this.clickSelect(event);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ // 移动
|
|
if (this.moveable) {
|
|
if (this.moveable) {
|
|
this._mouseDownPos = new SPoint(event.x, event.y);
|
|
this._mouseDownPos = new SPoint(event.x, event.y);
|
|
this._isMoving = true;
|
|
this._isMoving = true;
|
|
this.grabItem(this);
|
|
this.grabItem(this);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
- return false;
|
|
|
|
|
|
+ return select;
|
|
} // Function onMouseDown()
|
|
} // Function onMouseDown()
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -589,14 +590,14 @@ export class SGraphItem extends SObject {
|
|
*
|
|
*
|
|
* @param event 事件参数
|
|
* @param event 事件参数
|
|
*/
|
|
*/
|
|
- private clickSelect(event: SMouseEvent): void {
|
|
|
|
|
|
+ private clickSelect(event: SMouseEvent): boolean {
|
|
// 如果Item不可被选中,或没有按下鼠标左键,则直接返回
|
|
// 如果Item不可被选中,或没有按下鼠标左键,则直接返回
|
|
if (!this.selectable || event.buttons != SMouseButton.LeftButton) {
|
|
if (!this.selectable || event.buttons != SMouseButton.LeftButton) {
|
|
- return;
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
const scene = this.scene;
|
|
const scene = this.scene;
|
|
if (scene == null) {
|
|
if (scene == null) {
|
|
- return;
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
// 如果按下Ctrl键,只改变当前item的选择标志
|
|
// 如果按下Ctrl键,只改变当前item的选择标志
|
|
if (event.ctrlKey) {
|
|
if (event.ctrlKey) {
|
|
@@ -604,5 +605,6 @@ export class SGraphItem extends SObject {
|
|
} else {
|
|
} else {
|
|
scene.selectContainer.setItem(this);
|
|
scene.selectContainer.setItem(this);
|
|
}
|
|
}
|
|
|
|
+ return true;
|
|
} // Function clickSelect()
|
|
} // Function clickSelect()
|
|
} // Class SGraphItem
|
|
} // Class SGraphItem
|