From 26f9b541995a2bcb9f8f1a38dd26ca3340356a5d Mon Sep 17 00:00:00 2001 From: Preet <833927+pshihn@users.noreply.github.com> Date: Mon, 23 Oct 2023 21:41:00 -0700 Subject: [PATCH] compute midpoints properly when dealing with split line indices --- src/element/linearElementEditor.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/element/linearElementEditor.ts b/src/element/linearElementEditor.ts index 49563e7c0..0688edeac 100644 --- a/src/element/linearElementEditor.ts +++ b/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],