fix: Undo for elbow arrows create incorrect routing (#9046)

This commit is contained in:
Márk Tolmács 2025-01-24 20:18:08 +01:00 committed by GitHub
parent 8f20b29b73
commit 49f1276ef2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 125 additions and 126 deletions

View file

@ -909,6 +909,20 @@ export const updateElbowArrowPoints = (
);
}
// 0. During all element replacement in the scene, we just need to renormalize
// the arrow
// TODO (dwelle,mtolmacs): Remove this once Scene.getScene() is removed
if (elementsMap.size === 0 && updates.points) {
return normalizeArrowElementUpdate(
updates.points.map((p) =>
pointFrom<GlobalPoint>(arrow.x + p[0], arrow.y + p[1]),
),
arrow.fixedSegments,
arrow.startIsSpecial,
arrow.endIsSpecial,
);
}
const updatedPoints: readonly LocalPoint[] = updates.points
? updates.points && updates.points.length === 2
? arrow.points.map((p, idx) =>