|
@@ -151,6 +151,25 @@ export class RelationItem extends BaseRelationItem {
|
|
|
} // Function onKeyUp()
|
|
|
|
|
|
/**
|
|
|
+ * 鼠标右键事件
|
|
|
+ *
|
|
|
+ * @param event 事件参数
|
|
|
+ * @return boolean
|
|
|
+ */
|
|
|
+ onContextMenu(event: SMouseEvent): boolean {
|
|
|
+ this.$emit("ContextMenu", event);
|
|
|
+ return true;
|
|
|
+ } // Function onContextMenu()
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ *
|
|
|
+ */
|
|
|
+ contains(x: number, y: number): boolean {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 根据点计算出折线点
|
|
|
*
|
|
|
*/
|
|
@@ -166,29 +185,37 @@ export class RelationItem extends BaseRelationItem {
|
|
|
change(): void {
|
|
|
if (this.pointList.length) {
|
|
|
if (this.Anchor1) {
|
|
|
- this.pointList[0] = this.Anchor1.mapToScene(
|
|
|
- this.Anchor1.X,
|
|
|
- this.Anchor1.Y
|
|
|
- );
|
|
|
- if (this.pointList[1] && this.pointList[2]) {
|
|
|
- this.pointList[1] = this.getPoint(
|
|
|
- this.pointList[0],
|
|
|
- this.pointList[2]
|
|
|
+ // 判断删除equip后,不移动
|
|
|
+ if (this.Anchor1.parent && this.Anchor1.parent.parent) {
|
|
|
+ this.pointList[0] = this.Anchor1.mapToScene(
|
|
|
+ this.Anchor1.X,
|
|
|
+ this.Anchor1.Y
|
|
|
);
|
|
|
+ if (this.pointList[1] && this.pointList[2]) {
|
|
|
+ this.pointList[1] = this.getPoint(
|
|
|
+ this.pointList[0],
|
|
|
+ this.pointList[2]
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (this.Anchor2) {
|
|
|
- this.pointList[
|
|
|
- this.pointList.length - 1
|
|
|
- ] = this.Anchor2.mapToScene(this.Anchor2.X, this.Anchor2.Y);
|
|
|
- if (
|
|
|
- this.pointList[this.pointList.length - 1] &&
|
|
|
- this.pointList[this.pointList.length - 3]
|
|
|
- ) {
|
|
|
- this.pointList[this.pointList.length - 2] = this.getPoint(
|
|
|
- this.pointList[this.pointList.length - 1],
|
|
|
+ // 删除equip后
|
|
|
+ if (this.Anchor2.parent && this.Anchor2.parent.parent) {
|
|
|
+ this.pointList[
|
|
|
+ this.pointList.length - 1
|
|
|
+ ] = this.Anchor2.mapToScene(this.Anchor2.X, this.Anchor2.Y);
|
|
|
+ if (
|
|
|
+ this.pointList[this.pointList.length - 1] &&
|
|
|
this.pointList[this.pointList.length - 3]
|
|
|
- );
|
|
|
+ ) {
|
|
|
+ this.pointList[
|
|
|
+ this.pointList.length - 2
|
|
|
+ ] = this.getPoint(
|
|
|
+ this.pointList[this.pointList.length - 1],
|
|
|
+ this.pointList[this.pointList.length - 3]
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|