Procházet zdrojové kódy

复制出的item默认可移动

haojianlong před 4 roky
rodič
revize
0af1e3a337
1 změnil soubory, kde provedl 15 přidání a 6 odebrání
  1. 15 6
      src/components/mapClass/EditScence.ts

+ 15 - 6
src/components/mapClass/EditScence.ts

@@ -1186,13 +1186,17 @@ export class EditScence extends SGraphScene {
         parserData.parseData(JSON.parse(JSON.stringify(this.copyString)))
         // 不需要复制区域
         // parserData.zoneLegendList.forEach(t => {
-        //     if (this.view) {
-        //         t.pos.x += 10 / this.view.scale
-        //         t.pos.y += 10 / this.view.scale
+        //     if (t instanceof SCustomLegendItem) {
+        //         if (this.view) {
+        //             t.pos.x += 10 / this.view.scale
+        //             t.pos.y += 10 / this.view.scale
+        //         }
+        //         this.addItem(t)
+        //         this.Nodes.push(t);
+        //         graphItemList.push(t)
         //     }
-        //     this.addItem(t)
-        // // 加到node
-        // // 加命令
+        //  // 加到node
+        //  // 加命令
         // })
         const graphItemList = [];
         parserData.imageLegendList.forEach(t => {
@@ -1200,6 +1204,7 @@ export class EditScence extends SGraphScene {
                 t.pos.x += 10 / this.view.scale
                 t.pos.y += 10 / this.view.scale
             }
+            t.moveable = true;
             this.addItem(t)
             this.Nodes.push(t);
             graphItemList.push(t)
@@ -1209,6 +1214,7 @@ export class EditScence extends SGraphScene {
                 t.pos.x += 10 / this.view.scale
                 t.pos.y += 10 / this.view.scale
             }
+            t.moveable = true;
             this.addItem(t)
             this.Markers.push(t);
             graphItemList.push(t)
@@ -1218,6 +1224,7 @@ export class EditScence extends SGraphScene {
                 t.pos.x += 10 / this.view.scale
                 t.pos.y += 10 / this.view.scale
             }
+            t.moveable = true;
             this.addItem(t)
             this.Markers.push(t);
             graphItemList.push(t)
@@ -1227,6 +1234,7 @@ export class EditScence extends SGraphScene {
                 t.pos.x += 10 / this.view.scale
                 t.pos.y += 10 / this.view.scale
             }
+            t.moveable = true;
             this.addItem(t)
             this.Markers.push(t);
             graphItemList.push(t)
@@ -1237,6 +1245,7 @@ export class EditScence extends SGraphScene {
                 t.pos.y += 10 / this.view.scale
                 t.moveToOrigin(t.pos.x, t.pos.y)
             }
+            t.moveable = true;
             this.addItem(t)
             this.Relations.push(t);
             graphItemList.push(t)