Fix actionFinalize for new arrow creation

This commit is contained in:
Mark Tolmacs
2025-08-26 11:01:45 +02:00
parent 639d711e53
commit 1267e0537c

View File

@@ -82,11 +82,12 @@ export const actionFinalize = register<FormData>({
); );
if (isBindingElement(element)) { if (isBindingElement(element)) {
const newArrow = !appState.selectedLinearElement?.selectedPointsIndices; const newArrow = !!appState.newElement;
const selectedPointsIndices = newArrow const selectedPointsIndices =
? [element.points.length - 1] // New arrow creation newArrow || !appState.selectedLinearElement.selectedPointsIndices
: appState.selectedLinearElement.selectedPointsIndices; ? [element.points.length - 1] // New arrow creation
: appState.selectedLinearElement.selectedPointsIndices;
const draggedPoints: PointsPositionUpdates = const draggedPoints: PointsPositionUpdates =
selectedPointsIndices.reduce((map, index) => { selectedPointsIndices.reduce((map, index) => {