fix: Linear to elbow conversion crash (#9556)

* Fix linear to elbow conversion

* Add invariant check

* Add dev invariant fix

* Add arrowhead
This commit is contained in:
Márk Tolmács
2025-05-22 12:34:15 +02:00
committed by GitHub
parent 27522110df
commit 91d36e9b81
2 changed files with 21 additions and 1 deletions
@@ -564,7 +564,7 @@ export const convertElementTypes = (
continue;
}
const fixedSegments: FixedSegment[] = [];
for (let i = 0; i < nextPoints.length - 1; i++) {
for (let i = 1; i < nextPoints.length - 2; i++) {
fixedSegments.push({
start: nextPoints[i],
end: nextPoints[i + 1],
@@ -581,6 +581,7 @@ export const convertElementTypes = (
);
mutateElement(element, app.scene.getNonDeletedElementsMap(), {
...updates,
endArrowhead: "arrow",
});
} else {
// if we're converting to non-elbow linear element, check if