|
@@ -31,8 +31,8 @@ import {
|
|
|
SAnchorItem,
|
|
|
SGraphItem
|
|
|
} from "@persagy-web/graph";
|
|
|
-import {SItemStatus, ItemOrder} from "..";
|
|
|
-import {SMouseEvent} from "@persagy-web/base";
|
|
|
+import { SItemStatus, ItemOrder } from "..";
|
|
|
+import { SMouseEvent } from "@persagy-web/base";
|
|
|
import {
|
|
|
SSize,
|
|
|
SRect,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
SFont,
|
|
|
SPoint
|
|
|
} from "@persagy-web/draw";
|
|
|
-import {Anchor} from "../types/topology/Anchor";
|
|
|
+import { Anchor } from "../types/topology/Anchor";
|
|
|
|
|
|
/**
|
|
|
* 图例 item
|
|
@@ -61,11 +61,13 @@ export class SIconTextItem extends SObjectItem {
|
|
|
this.moveable = true;
|
|
|
this.textItem.moveable = false;
|
|
|
this.img.moveable = false;
|
|
|
- } else if (v == SItemStatus.Edit) { // 编辑状态时
|
|
|
+ } else if (v == SItemStatus.Edit) {
|
|
|
+ // 编辑状态时
|
|
|
this.moveable = false;
|
|
|
this.textItem.moveable = true;
|
|
|
this.img.moveable = true;
|
|
|
- } else if (v == SItemStatus.Create) { // 创建状态时
|
|
|
+ } else if (v == SItemStatus.Create) {
|
|
|
+ // 创建状态时
|
|
|
this.moveable = true;
|
|
|
this.textItem.moveable = false;
|
|
|
this.img.moveable = false;
|
|
@@ -275,10 +277,10 @@ export class SIconTextItem extends SObjectItem {
|
|
|
});
|
|
|
} else {
|
|
|
anchorPoint = [
|
|
|
- {x: this.img.x, y: this.img.y, id: ""},
|
|
|
- {x: this.img.x, y: this.img.y, id: ""},
|
|
|
- {x: this.img.x, y: this.img.y, id: ""},
|
|
|
- {x: this.img.x, y: this.img.y, id: ""}
|
|
|
+ { x: this.img.x, y: this.img.y, id: "" },
|
|
|
+ { x: this.img.x, y: this.img.y, id: "" },
|
|
|
+ { x: this.img.x, y: this.img.y, id: "" },
|
|
|
+ { x: this.img.x, y: this.img.y, id: "" }
|
|
|
// { x: this.img.x, y: this.img.y + this.img.height / 2, id: "" },
|
|
|
// { x: this.img.x, y: this.img.y - this.img.height / 2, id: "" },
|
|
|
// { x: this.img.x - this.img.width / 2, y: this.img.y, id: "" },
|
|
@@ -312,10 +314,10 @@ export class SIconTextItem extends SObjectItem {
|
|
|
// 判断是否有锚点
|
|
|
if (this.anchorList.length) {
|
|
|
let anchorPoint = [
|
|
|
- {x: this.img.x, y: this.img.y},
|
|
|
- {x: this.img.x, y: this.img.y},
|
|
|
- {x: this.img.x, y: this.img.y},
|
|
|
- {x: this.img.x, y: this.img.y}
|
|
|
+ { x: this.img.x, y: this.img.y },
|
|
|
+ { x: this.img.x, y: this.img.y },
|
|
|
+ { x: this.img.x, y: this.img.y },
|
|
|
+ { x: this.img.x, y: this.img.y }
|
|
|
// { x: this.img.x, y: this.img.y + this.img.height / 2 },
|
|
|
// { x: this.img.x, y: this.img.y - this.img.height / 2 },
|
|
|
// { x: this.img.x - this.img.width / 2, y: this.img.y },
|
|
@@ -337,7 +339,8 @@ export class SIconTextItem extends SObjectItem {
|
|
|
// 如果为show状态 双击改对象则需改为编辑状态
|
|
|
if (this.status == SItemStatus.Normal) {
|
|
|
return super.onMouseDown(event);
|
|
|
- } else if (this.status == SItemStatus.Edit) { // 编辑状态时
|
|
|
+ } else if (this.status == SItemStatus.Edit) {
|
|
|
+ // 编辑状态时
|
|
|
return super.onMouseDown(event);
|
|
|
}
|
|
|
return true;
|
|
@@ -364,7 +367,8 @@ export class SIconTextItem extends SObjectItem {
|
|
|
if (SItemStatus.Normal == this.status) {
|
|
|
this.status = SItemStatus.Edit;
|
|
|
this.grabItem(this);
|
|
|
- } else if (SItemStatus.Edit == this.status) { // 处于编辑状态时
|
|
|
+ } else if (SItemStatus.Edit == this.status) {
|
|
|
+ // 处于编辑状态时
|
|
|
this.status = SItemStatus.Normal;
|
|
|
this.releaseItem();
|
|
|
}
|