فهرست منبع

修复bug:34670

xushiting 2 سال پیش
والد
کامیت
1559f7cc49
2فایلهای تغییر یافته به همراه8 افزوده شده و 3 حذف شده
  1. 6 3
      src/views/draw-file/board/editCAD/Geometry/Circle.js
  2. 2 0
      src/views/draw-file/board/editCAD/Renderer/Draw.js

+ 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