Selaa lähdekoodia

compute midpoints properly when dealing with split line indices

Preet 1 vuosi sitten
vanhempi
commit
26f9b54199
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      src/element/linearElementEditor.ts

+ 4 - 1
src/element/linearElementEditor.ts

@@ -547,7 +547,10 @@ export class LinearElementEditor {
     endPointIndex: number,
   ) {
     let segmentMidPoint = centerPoint(startPoint, endPoint);
-    if (element.points.length > 2 && element.roundness) {
+    const splits = element.segmentSplitIndices || [];
+    const treatAsCurve =
+      splits.includes(endPointIndex) || splits.includes(endPointIndex - 1);
+    if (element.points.length > 2 && (element.roundness || treatAsCurve)) {
       const controlPoints = getControlPointsForBezierCurve(
         element,
         element.points[endPointIndex],