Browse Source

feat:getDefaultSetting 默认为1

jinx 2 years ago
parent
commit
1816312923
3 changed files with 20 additions and 11 deletions
  1. 2 1
      src/graphic/Controls/UIControl.js
  2. 7 2
      src/graphic/Layer.js
  3. 11 8
      src/graphic/ListenLayer.js

+ 2 - 1
src/graphic/Controls/UIControl.js

@@ -539,7 +539,8 @@ export default class UIControl {
     return {
       singleRoadWidth: singleLaneWidth * coordinate.res,
       roadQuarantineWidth: roadMidDivideWidth * coordinate.res,
-      lineWidth: lineWidth * coordinate.res * 1000,
+      // lineWidth: lineWidth * coordinate.res * 1000,
+      lineWidth: lineWidth ,
     };
   }
 

+ 7 - 2
src/graphic/Layer.js

@@ -348,8 +348,12 @@ export default class Layer {
     if (Math.abs(X - this.startX) > minDragDis || Math.abs(Y - this.startY) > minDragDis) {
       // 是否拖拽了
       if (eventName != null) {
-        stateService.clearFocusItem();
-        this.uiControl.focusVector = null;
+        // console.log(stateService.getFocusItem(),stateService.getSelectItem());
+        if (eventName == LayerEvents.MoveMagnifier && stateService.getSelectItem().state != 0) {
+        } else {
+          stateService.clearFocusItem();
+          this.uiControl.focusVector = null;
+        }
       }
     }
 
@@ -977,6 +981,7 @@ export default class Layer {
         };
         this.uiControl.focusVector = focusItem;
         stateService.setFocusItem(focusItem);
+
         break;
       case LayerEvents.MoveSVG:
         needAutoRedraw = true;

+ 11 - 8
src/graphic/ListenLayer.js

@@ -12,9 +12,8 @@ import { draw } from "./Renderer/Draw.js";
 import { edgeService } from "./Service/EdgeService";
 import VectorCategory from "./enum/VectorCategory";
 import LayerEvents from "./enum/LayerEvents";
-
 export default class ListenLayer {
-  constructor() {
+  constructor(canvas, newsletter, graphicState) {
     this.modifyPoint = null;
   }
 
@@ -1285,12 +1284,16 @@ export default class ListenLayer {
         VectorType.SVG,
         this.modifyPoint.index
       );
-    } else if (this.modifyPoint.magnifierId) {
-      stateService.setSelectItem(
-        this.modifyPoint.magnifierId,
-        VectorType.Magnifier,
-        this.modifyPoint.index
-      );
+    } else if (this.modifyPoint.magnifierId) {  
+      // if(this.modifyPoint.index==0){
+        //点击隐藏的放大镜不显示
+        stateService.setSelectItem(
+          this.modifyPoint.magnifierId,
+          VectorType.Magnifier,
+          this.modifyPoint.index
+        );
+      // }
+    
     } else if (this.modifyPoint.linkedEdgeId) {
       stateService.setSelectItem(
         this.modifyPoint.linkedEdgeId,