mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-09 15:24:25 +01:00
fix: Arrow vanishes when orbit binding to the same element
This commit is contained in:
@@ -434,6 +434,10 @@ const bindingStrategyForSimpleArrowEndpointDragging = (
|
|||||||
mode: "inside",
|
mode: "inside",
|
||||||
}
|
}
|
||||||
: { mode: null };
|
: { mode: null };
|
||||||
|
other =
|
||||||
|
finalize && hit && hit.id === oppositeBinding?.elementId
|
||||||
|
? { mode: null }
|
||||||
|
: other;
|
||||||
|
|
||||||
return { current, other };
|
return { current, other };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2220,14 +2220,12 @@ const pointDraggingUpdates = (
|
|||||||
const startIsDraggingOverEndElement =
|
const startIsDraggingOverEndElement =
|
||||||
element.endBinding &&
|
element.endBinding &&
|
||||||
nextArrow.startBinding &&
|
nextArrow.startBinding &&
|
||||||
app.state.bindMode === "inside" &&
|
startIsDragged &&
|
||||||
endIsDragged &&
|
|
||||||
nextArrow.startBinding.elementId === element.endBinding.elementId;
|
nextArrow.startBinding.elementId === element.endBinding.elementId;
|
||||||
const endIsDraggingOverStartElement =
|
const endIsDraggingOverStartElement =
|
||||||
element.startBinding &&
|
element.startBinding &&
|
||||||
nextArrow.endBinding &&
|
nextArrow.endBinding &&
|
||||||
app.state.bindMode === "inside" &&
|
endIsDragged &&
|
||||||
startIsDragged &&
|
|
||||||
element.startBinding.elementId === nextArrow.endBinding.elementId;
|
element.startBinding.elementId === nextArrow.endBinding.elementId;
|
||||||
|
|
||||||
// We need to update the non-dragged point too if bound,
|
// We need to update the non-dragged point too if bound,
|
||||||
@@ -2238,8 +2236,11 @@ const pointDraggingUpdates = (
|
|||||||
nextArrow.endBinding.elementId,
|
nextArrow.endBinding.elementId,
|
||||||
)! as ExcalidrawBindableElement)
|
)! as ExcalidrawBindableElement)
|
||||||
: null;
|
: null;
|
||||||
const endLocalPoint =
|
const endLocalPoint = startIsDraggingOverEndElement
|
||||||
endBindable && !endIsDraggingOverStartElement
|
? nextArrow.points[nextArrow.points.length - 1]
|
||||||
|
: endIsDraggingOverStartElement && app.state.bindMode !== "inside"
|
||||||
|
? nextArrow.points[0]
|
||||||
|
: endBindable
|
||||||
? updateBoundPoint(
|
? updateBoundPoint(
|
||||||
nextArrow,
|
nextArrow,
|
||||||
"endBinding",
|
"endBinding",
|
||||||
@@ -2263,8 +2264,11 @@ const pointDraggingUpdates = (
|
|||||||
)! as ExcalidrawBindableElement)
|
)! as ExcalidrawBindableElement)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
const startLocalPoint =
|
const startLocalPoint = endIsDraggingOverStartElement
|
||||||
startBindable && startIsDraggingOverEndElement
|
? nextArrow.points[0]
|
||||||
|
: startIsDraggingOverEndElement && app.state.bindMode !== "inside"
|
||||||
|
? nextArrow.points[nextArrow.points.length - 1]
|
||||||
|
: startBindable
|
||||||
? updateBoundPoint(
|
? updateBoundPoint(
|
||||||
nextArrow,
|
nextArrow,
|
||||||
"startBinding",
|
"startBinding",
|
||||||
|
|||||||
Reference in New Issue
Block a user