feat: Ghost points at the end of the splines

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs
2026-03-20 14:33:04 +00:00
parent c1082923ee
commit c94e05970d
6 changed files with 172 additions and 80 deletions
@@ -790,9 +790,20 @@ export class LinearElementEditor {
elementsMap,
);
// For curved (non-elbow) arrows the quadratic spline produces N-2 arcs
// for N anchor points. Cap the loop to the actual segment count so we
// don't request a midpoint for a segment that doesn't exist.
const [lines, segCurves] = deconstructLinearOrFreeDrawElement(element);
const segmentCount = lines.length + segCurves.length;
let index = 0;
const midpoints: (GlobalPoint | null)[] = [];
while (index < points.length - 1) {
if (segmentCount > 0 && index >= segmentCount) {
midpoints.push(null);
index++;
continue;
}
if (
LinearElementEditor.isSegmentTooShort(
element,