mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-17 22:40:54 +02:00
fix: attempt at fixing the dancing arrows
This commit is contained in:
@@ -240,6 +240,30 @@ export const getStartGlobalEndLocalPointsForSimpleArrowBinding = (
|
||||
): [GlobalPoint, LocalPoint] => {
|
||||
let startGlobalPoint = startPoint;
|
||||
let endLocalPoint = endPoint;
|
||||
|
||||
if (end.mode) {
|
||||
const newEndLocalPoint = updateBoundPoint(
|
||||
arrow,
|
||||
"endBinding",
|
||||
end.mode
|
||||
? {
|
||||
...calculateFixedPointForNonElbowArrowBinding(
|
||||
arrow,
|
||||
end.element,
|
||||
"end",
|
||||
elementsMap,
|
||||
end.focusPoint,
|
||||
),
|
||||
elementId: end.element.id,
|
||||
mode: end.mode,
|
||||
}
|
||||
: null,
|
||||
end.element,
|
||||
elementsMap,
|
||||
);
|
||||
endLocalPoint = newEndLocalPoint ?? endLocalPoint;
|
||||
}
|
||||
|
||||
if (start.mode) {
|
||||
const newStartLocalPoint = updateBoundPoint(
|
||||
arrow,
|
||||
@@ -269,29 +293,6 @@ export const getStartGlobalEndLocalPointsForSimpleArrowBinding = (
|
||||
: startGlobalPoint;
|
||||
}
|
||||
|
||||
if (end.mode) {
|
||||
const newEndLocalPoint = updateBoundPoint(
|
||||
arrow,
|
||||
"endBinding",
|
||||
end.mode
|
||||
? {
|
||||
...calculateFixedPointForNonElbowArrowBinding(
|
||||
arrow,
|
||||
end.element,
|
||||
"end",
|
||||
elementsMap,
|
||||
end.focusPoint,
|
||||
),
|
||||
elementId: end.element.id,
|
||||
mode: end.mode,
|
||||
}
|
||||
: null,
|
||||
end.element,
|
||||
elementsMap,
|
||||
);
|
||||
endLocalPoint = newEndLocalPoint ?? endLocalPoint;
|
||||
}
|
||||
|
||||
return [
|
||||
startGlobalPoint,
|
||||
pointFrom<LocalPoint>(
|
||||
|
Reference in New Issue
Block a user