mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-19 04:05:19 +01:00
fix: Elbow arrow direction at binding
This commit is contained in:
@@ -2142,7 +2142,7 @@ const pointDraggingUpdates = (
|
||||
);
|
||||
|
||||
// Linear elements have no special logic
|
||||
if (!isArrowElement(element) || isElbowArrow(element)) {
|
||||
if (!isArrowElement(element)) {
|
||||
return {
|
||||
positions: naiveDraggingPoints,
|
||||
};
|
||||
@@ -2153,12 +2153,6 @@ const pointDraggingUpdates = (
|
||||
element.points.length - 1,
|
||||
);
|
||||
|
||||
if (startIsDragged === endIsDragged) {
|
||||
return {
|
||||
positions: naiveDraggingPoints,
|
||||
};
|
||||
}
|
||||
|
||||
const { start, end } = getBindingStrategyForDraggingBindingElementEndpoints(
|
||||
element,
|
||||
naiveDraggingPoints,
|
||||
@@ -2172,6 +2166,25 @@ const pointDraggingUpdates = (
|
||||
},
|
||||
);
|
||||
|
||||
if (isElbowArrow(element)) {
|
||||
return {
|
||||
positions: naiveDraggingPoints,
|
||||
updates: {
|
||||
suggestedBinding: startIsDragged
|
||||
? start.element
|
||||
: endIsDragged
|
||||
? end.element
|
||||
: null,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
if (startIsDragged === endIsDragged) {
|
||||
return {
|
||||
positions: naiveDraggingPoints,
|
||||
};
|
||||
}
|
||||
|
||||
// Generate the next bindings for the arrow
|
||||
const updates: PointMoveOtherUpdates = {
|
||||
suggestedBinding: null,
|
||||
|
||||
Reference in New Issue
Block a user