|
@@ -4,6 +4,7 @@ import { SPoint, SPainter, SColor, SLineCapStyle } from "@saga-web/draw/lib";
|
|
import { ItemOrder, SLineItem, SItemStatus } from '@saga-web/big/lib';
|
|
import { ItemOrder, SLineItem, SItemStatus } from '@saga-web/big/lib';
|
|
import { Marker } from '../types/Marker';
|
|
import { Marker } from '../types/Marker';
|
|
import { uuid } from '@/components/mapClass/until';
|
|
import { uuid } from '@/components/mapClass/until';
|
|
|
|
+import { SMouseEvent } from '@saga-web/base/lib';
|
|
|
|
|
|
/**
|
|
/**
|
|
* 标识对象Item(线类型)
|
|
* 标识对象Item(线类型)
|
|
@@ -89,18 +90,31 @@ export class SLineMarkerItem extends SLineItem {
|
|
// 判断删除equip后,不移动
|
|
// 判断删除equip后,不移动
|
|
if (this.startItem.parent) {
|
|
if (this.startItem.parent) {
|
|
let scenePoint: SPoint = this.startItem.boundingRect().center();
|
|
let scenePoint: SPoint = this.startItem.boundingRect().center();
|
|
- this.line[0] = this.startItem.mapToScene(scenePoint.x, scenePoint.y);
|
|
|
|
|
|
+ let p = this.startItem.mapToScene(scenePoint.x, scenePoint.y);
|
|
|
|
+ this.line[0] = new SPoint(p.x - this.x, p.y - this.y)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.endItem) {
|
|
if (this.endItem) {
|
|
// 删除equip后
|
|
// 删除equip后
|
|
if (this.endItem.parent) {
|
|
if (this.endItem.parent) {
|
|
let scenePoint: SPoint = this.endItem.boundingRect().center();
|
|
let scenePoint: SPoint = this.endItem.boundingRect().center();
|
|
- this.line[1] = this.endItem.mapToScene(scenePoint.x, scenePoint.y);
|
|
|
|
|
|
+ let p = this.endItem.mapToScene(scenePoint.x, scenePoint.y);
|
|
|
|
+ this.line[1] = new SPoint(p.x - this.x, p.y - this.y)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 鼠标按下事件
|
|
|
|
+ *
|
|
|
|
+ * @param event 保存事件参数
|
|
|
|
+ * @return boolean
|
|
|
|
+ */
|
|
|
|
+ onMouseDown(event: SMouseEvent): boolean {
|
|
|
|
+ super.onMouseDown(event)
|
|
|
|
+ return true;
|
|
|
|
+ } // Function onMouseDown()
|
|
|
|
+
|
|
toData(): Marker {
|
|
toData(): Marker {
|
|
this.data.Pos = { X: this.x, Y: this.y };
|
|
this.data.Pos = { X: this.x, Y: this.y };
|
|
this.data.Properties.Line = this.line.map(pos => {
|
|
this.data.Properties.Line = this.line.map(pos => {
|