Procházet zdrojové kódy

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-editer into develop

shaun-sheep před 4 roky
rodič
revize
06e5e28c72
1 změnil soubory, kde provedl 14 přidání a 10 odebrání
  1. 14 10
      src/components/mapClass/EditScence.ts

+ 14 - 10
src/components/mapClass/EditScence.ts

@@ -1490,16 +1490,9 @@ export class EditScence extends SGraphScene {
         this.Nodes.forEach(image => {
             // image.showAnchor = false;
             if (image.anchorList && image.anchorList.length) {
-                let scenePoint = image.mapFromScene(event.x, event.y);
-                if (image.contains(scenePoint.x, scenePoint.y)) {
-                    // image.anchorList.forEach(anchor => {
-                    //     let anchorPoint = anchor.mapToScene(0, 0);
-                    //     let dis = SMathUtil.pointDistance(
-                    //         event.x,
-                    //         event.y,
-                    //         anchorPoint.x,
-                    //         anchorPoint.y
-                    //     );
+                if(image.img && image.img instanceof SImageItem) {
+                    let scenePoint = image.img.mapFromScene(event.x, event.y);
+                    if (image.img.contains(scenePoint.x, scenePoint.y)) {
                         let anchor = image.anchorList[0]
                         let anchorPoint = anchor.mapToScene(0, 0);
                         let dis = SMathUtil.pointDistance(
@@ -1517,6 +1510,17 @@ export class EditScence extends SGraphScene {
                             minAnchor = anchor;
                             len = dis;
                         }
+                    }
+                // let scenePoint = image.mapFromScene(event.x, event.y);
+                // if (image.contains(scenePoint.x, scenePoint.y)) {
+                    // image.anchorList.forEach(anchor => {
+                    //     let anchorPoint = anchor.mapToScene(0, 0);
+                    //     let dis = SMathUtil.pointDistance(
+                    //         event.x,
+                    //         event.y,
+                    //         anchorPoint.x,
+                    //         anchorPoint.y
+                    //     );
                         // if (len < 0) {
                         //     len = anchor.sceneDis;
                         // }