|
@@ -313,33 +313,33 @@ export default {
|
|
|
parse.relations.forEach((t) => {
|
|
|
// 设置锚点
|
|
|
// (此处为吸附功能、需要要求注掉)
|
|
|
- // if (t.anchor1Id) {
|
|
|
- // let startAnc = null;
|
|
|
- // anchorList.forEach((aItem) => {
|
|
|
- // if (aItem.id == t.anchor1Id) {
|
|
|
- // startAnc = aItem;
|
|
|
- // }
|
|
|
- // });
|
|
|
+ if (t.anchor1Id) {
|
|
|
+ let startAnc = null;
|
|
|
+ anchorList.forEach((aItem) => {
|
|
|
+ if (aItem.id == t.anchor1Id) {
|
|
|
+ startAnc = aItem;
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- // if (startAnc) {
|
|
|
- // startAnc.isConnected = true;
|
|
|
- // startAnc.parent?.connect("changePos", t, t.changePos);
|
|
|
- // t.startAnchor = startAnc || null;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if (t.anchor2Id) {
|
|
|
- // let endAnc = null;
|
|
|
- // anchorList.forEach((aItem) => {
|
|
|
- // if (aItem.id == t.anchor2Id) {
|
|
|
- // endAnc = aItem;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // if (endAnc) {
|
|
|
- // endAnc.isConnected = true;
|
|
|
- // endAnc.parent?.connect("changePos", t, t.changePos);
|
|
|
- // t.endAnchor = endAnc || null;
|
|
|
- // }
|
|
|
- // }
|
|
|
+ if (startAnc) {
|
|
|
+ startAnc.isConnected = true;
|
|
|
+ startAnc.parent?.connect("changePos", t, t.changePos);
|
|
|
+ t.startAnchor = startAnc || null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (t.anchor2Id) {
|
|
|
+ let endAnc = null;
|
|
|
+ anchorList.forEach((aItem) => {
|
|
|
+ if (aItem.id == t.anchor2Id) {
|
|
|
+ endAnc = aItem;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (endAnc) {
|
|
|
+ endAnc.isConnected = true;
|
|
|
+ endAnc.parent?.connect("changePos", t, t.changePos);
|
|
|
+ t.endAnchor = endAnc || null;
|
|
|
+ }
|
|
|
+ }
|
|
|
t.connect("finishCreated", this.scene, this.scene.finishCreated);
|
|
|
t.connect("onContextMenu", this, this.scene.getItem);
|
|
|
this.scene.addItem(t);
|