Sfoglia il codice sorgente

fix: Crash when adding a new point in the line editor #5602 (#5606)

Update linearElementEditor.ts
zsviczian 2 anni fa
parent
commit
f1ae37c84b
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      src/element/linearElementEditor.ts

+ 3 - 1
src/element/linearElementEditor.ts

@@ -686,7 +686,9 @@ export class LinearElementEditor {
 
 
     const point = element.points[index];
     const point = element.points[index];
     const { x, y } = element;
     const { x, y } = element;
-    return rotate(x + point[0], y + point[1], cx, cy, element.angle);
+    return point
+      ? rotate(x + point[0], y + point[1], cx, cy, element.angle)
+      : rotate(x, y, cx, cy, element.angle);
   }
   }
 
 
   static pointFromAbsoluteCoords(
   static pointFromAbsoluteCoords(