瀏覽代碼

修复bug:34670

xushiting 2 年之前
父節點
當前提交
1559f7cc49

+ 6 - 3
src/views/draw-file/board/editCAD/Geometry/Circle.js

@@ -49,11 +49,14 @@ export default class Circle extends Geometry {
             }
         }
 
-        const dis = mathUtil.getDistance(position, this.center)
-        if(dis<this.radius){
+        // const dis = mathUtil.getDistance(position, this.center)
+        // if(dis<this.radius){
+        //     return SelectState.All
+        // }
+        const flag = mathUtil.isPointInPoly(position,this.points)
+        if(flag){
             return SelectState.All
         }
-
         return null;
     }
 

+ 2 - 0
src/views/draw-file/board/editCAD/Renderer/Draw.js

@@ -436,6 +436,7 @@ export default class Draw {
                     this.context.strokeStyle = Style.Select.Circle.strokeStyle
                     this.context.fillStyle = Style.Select.Circle.fillStyle
                     fillFlag = true;
+                    this.drawRec(geometry.points)
                 }
                 else if(selectItem.selectIndex.indexOf(SelectState.Vertex)>-1){
                     this.context.strokeStyle = Style.Select.Circle.strokeStyle
@@ -454,6 +455,7 @@ export default class Draw {
                     this.context.strokeStyle = Style.Select.Circle.strokeStyle
                     this.context.fillStyle = Style.Select.Circle.fillStyle
                     fillFlag = true;
+                    this.drawRec(geometry.points)
                 }
                 else if(draggingItem.selectIndex.indexOf(SelectState.Vertex)>-1){
                     this.context.strokeStyle = Style.Select.Circle.strokeStyle