Fix arrow drag selection logic

This commit is contained in:
Mark Tolmacs
2025-08-25 16:02:37 +02:00
parent 691e425f83
commit 3a49f0d792

View File

@@ -140,8 +140,11 @@ export const dragSelectedElements = (
simultaneouslyUpdated: Array.from(elementsToUpdate), simultaneouslyUpdated: Array.from(elementsToUpdate),
}); });
} else if ( } else if (
// NOTE: Add a little initial drag to the arrow dragging to avoid // NOTE: Add a little initial drag to the arrow dragging when the arrow
// accidentally unbinding the arrow when the user just wants to select it. // is the single element being dragged to avoid accidentally unbinding
// the arrow when the user just wants to select it.
elementsToUpdate.size > 1 ||
Math.max(Math.abs(adjustedOffset.x), Math.abs(adjustedOffset.y)) > Math.max(Math.abs(adjustedOffset.x), Math.abs(adjustedOffset.y)) >
DRAGGING_THRESHOLD || DRAGGING_THRESHOLD ||
(!element.startBinding && !element.endBinding) (!element.startBinding && !element.endBinding)