mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-10-06 23:59:56 +02:00
fix: Allow already inside bound arrows to continue inside binding
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
@@ -390,6 +390,7 @@ const bindingStrategyForNewSimpleArrowEndpointDragging = (
|
||||
|
||||
const bindingStrategyForSimpleArrowEndpointDragging = (
|
||||
point: GlobalPoint,
|
||||
currentBinding: FixedPointBinding | null,
|
||||
oppositeBinding: FixedPointBinding | null,
|
||||
elementsMap: NonDeletedSceneElementsMap,
|
||||
elements: readonly Ordered<NonDeletedExcalidrawElement>[],
|
||||
@@ -441,6 +442,17 @@ const bindingStrategyForSimpleArrowEndpointDragging = (
|
||||
return { current: { mode: null }, other };
|
||||
}
|
||||
|
||||
// Already inside binding over the same hit element should remain inside bound
|
||||
if (
|
||||
hit.id === currentBinding?.elementId &&
|
||||
currentBinding.mode === "inside"
|
||||
) {
|
||||
return {
|
||||
current: { mode: "inside", focusPoint: point, element: hit },
|
||||
other,
|
||||
};
|
||||
}
|
||||
|
||||
// The dragged point is inside the hovered bindable element
|
||||
if (oppositeBinding) {
|
||||
// The opposite binding is on the same element
|
||||
@@ -579,6 +591,7 @@ export const getBindingStrategyForDraggingBindingElementEndpoints = (
|
||||
|
||||
const { current, other } = bindingStrategyForSimpleArrowEndpointDragging(
|
||||
globalPoint,
|
||||
arrow.startBinding,
|
||||
arrow.endBinding,
|
||||
elementsMap,
|
||||
elements,
|
||||
@@ -600,6 +613,7 @@ export const getBindingStrategyForDraggingBindingElementEndpoints = (
|
||||
);
|
||||
const { current, other } = bindingStrategyForSimpleArrowEndpointDragging(
|
||||
globalPoint,
|
||||
arrow.endBinding,
|
||||
arrow.startBinding,
|
||||
elementsMap,
|
||||
elements,
|
||||
|
Reference in New Issue
Block a user