xushiting il y a 2 ans
Parent
commit
27cdcb4a36

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 35 - 33
src/graphic/Geometry/Circle.js

@@ -66,39 +66,41 @@ export default class Circle extends Geometry {
       this.setRadiusX(distance);
       distance = this.radiusY;
     }
-    const lines = mathUtil.getParallelLineForDistance(line, distance);
-    const vLine = mathUtil.getVerticalLine(line, this.center);
-    const join1 = mathUtil.getIntersectionPoint(lines.line1, vLine);
-    const join2 = mathUtil.getIntersectionPoint(lines.line2, vLine);
-    //顺时针
-    if (
-      !mathUtil.isClockwise([
-        this.points[index],
-        join1,
-        this.points[oppositeIndex],
-      ])
-    ) {
-      let nextIndex = this.getNext(index);
-      this.points[nextIndex] = {
-        x: join1.x,
-        y: join1.y,
-      };
-      nextIndex = this.getOpposite(nextIndex);
-      this.points[nextIndex] = {
-        x: join2.x,
-        y: join2.y,
-      };
-    } else {
-      let nextIndex = this.getNext(index);
-      this.points[nextIndex] = {
-        x: join2.x,
-        y: join2.y,
-      };
-      nextIndex = this.getOpposite(nextIndex);
-      this.points[nextIndex] = {
-        x: join1.x,
-        y: join1.y,
-      };
+    if (line) {
+      const lines = mathUtil.getParallelLineForDistance(line, distance);
+      const vLine = mathUtil.getVerticalLine(line, this.center);
+      const join1 = mathUtil.getIntersectionPoint(lines.line1, vLine);
+      const join2 = mathUtil.getIntersectionPoint(lines.line2, vLine);
+      //顺时针
+      if (
+        !mathUtil.isClockwise([
+          this.points[index],
+          join1,
+          this.points[oppositeIndex],
+        ])
+      ) {
+        let nextIndex = this.getNext(index);
+        this.points[nextIndex] = {
+          x: join1.x,
+          y: join1.y,
+        };
+        nextIndex = this.getOpposite(nextIndex);
+        this.points[nextIndex] = {
+          x: join2.x,
+          y: join2.y,
+        };
+      } else {
+        let nextIndex = this.getNext(index);
+        this.points[nextIndex] = {
+          x: join2.x,
+          y: join2.y,
+        };
+        nextIndex = this.getOpposite(nextIndex);
+        this.points[nextIndex] = {
+          x: join1.x,
+          y: join1.y,
+        };
+      }
     }
   }
 

+ 1 - 0
src/graphic/Layer.js

@@ -1243,6 +1243,7 @@ export default class Layer {
         break;
       case LayerEvents.MoveCircle:
         needAutoRedraw = true;
+        this.uiControl.clearSelectUI();
         this.history.save();
         break;
       case LayerEvents.AddPoint: