소스 검색

fix: 计算旋转点

bill 4 일 전
부모
커밋
3c23390bb8
1개의 변경된 파일1개의 추가작업 그리고 8개의 파일을 삭제
  1. 1 8
      src/graphic/Renderer/Draw.js

+ 1 - 8
src/graphic/Renderer/Draw.js

@@ -1492,14 +1492,7 @@ export default class Draw {
         })
       );
 
-      const center = { x: 0, y: 0 };
-      vector.points.forEach((point) => {
-        center.x += point.x;
-        center.y += point.y;
-      });
-      center.x /= vector.points.length;
-      center.y /= vector.points.length;
-
+      const center = vector.center;
       const len =
         mathUtil.getDistance(vector.points[0], vector.points[2]) / 2 +
         20 * coordinate.ratio;