|
@@ -321,6 +321,7 @@ export class EditScence extends SGraphScene {
|
|
|
this.addItem(Polylines);
|
|
|
this.Nodes.push(Polylines);
|
|
|
Polylines.connect("finishCreated", this, this.finishCreated);
|
|
|
+ this.finishCreated(Polylines)
|
|
|
this.focusItem = Polylines;
|
|
|
this.scenceUpdate(this);
|
|
|
}
|
|
@@ -762,6 +763,10 @@ export class EditScence extends SGraphScene {
|
|
|
event.y = this.highLight.point.y;
|
|
|
}
|
|
|
if (this.grabItem) {
|
|
|
+ // if (this.grabItem instanceof TipelineItem) {
|
|
|
+ // this.setTipeEndanchor(event)
|
|
|
+ // return true;
|
|
|
+ // }
|
|
|
return this.grabItem.onMouseDown(event);
|
|
|
}
|
|
|
switch (this.cmd) {
|
|
@@ -822,6 +827,28 @@ export class EditScence extends SGraphScene {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 设置结束锚点
|
|
|
+ *
|
|
|
+ */
|
|
|
+ setTipeEndanchor(event: SMouseEvent): void {
|
|
|
+ if (this.grabItem instanceof TipelineItem) {
|
|
|
+ const anc = this.clickIsAnchor(event);
|
|
|
+ if (anc) {
|
|
|
+ const p = anc.mapToScene(0, 0)
|
|
|
+ anc.isConnected = true;
|
|
|
+ event.x = p.x;
|
|
|
+ event.y = p.y;
|
|
|
+ if (this.grabItem.pointList.length) {
|
|
|
+ this.grabItem.endAnchor = anc;
|
|
|
+ anc.parent?.connect('changePos', this.grabItem, this.grabItem.changePos)
|
|
|
+ }
|
|
|
+ this.grabItem.status = SItemStatus.Normal;
|
|
|
+ }
|
|
|
+ this.grabItem.onMouseDown(event)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 划线时点击位置是否是锚点
|
|
|
*
|
|
|
* @param event 事件
|