fix: restore from invalid fixedSegments & type-safer point updates (#9899)

* fix: restore from invalid fixedSegments & type-safer point updates

* fix: Type updates and throw for invalid point states

---------

Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
David Luzar
2025-08-22 17:45:58 +02:00
committed by GitHub
parent 90ec2739ae
commit 531f3e5524
2 changed files with 34 additions and 18 deletions

View File

@@ -387,7 +387,10 @@ export const restoreElement = (
elbowed: true,
startBinding: repairBinding(element, element.startBinding),
endBinding: repairBinding(element, element.endBinding),
fixedSegments: element.fixedSegments,
fixedSegments:
element.fixedSegments?.length && base.points.length >= 4
? element.fixedSegments
: null,
startIsSpecial: element.startIsSpecial,
endIsSpecial: element.endIsSpecial,
})