fix: Elbow arrow direction at binding

This commit is contained in:
Mark Tolmacs
2025-11-11 16:48:42 +01:00
parent dfcda03a0a
commit 5bc59d11e3
3 changed files with 75 additions and 14 deletions

View File

@@ -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,