mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-26 02:40:07 +02:00
fix: Elbow arrow routing issue with diamonds and ellipses (#10021)
This commit is contained in:
@@ -999,6 +999,29 @@ export const bindPointToSnapToElementOutline = (
|
|||||||
intersector,
|
intersector,
|
||||||
FIXED_BINDING_DISTANCE,
|
FIXED_BINDING_DISTANCE,
|
||||||
).sort(pointDistanceSq)[0];
|
).sort(pointDistanceSq)[0];
|
||||||
|
|
||||||
|
if (!intersection) {
|
||||||
|
const anotherPoint = pointFrom<GlobalPoint>(
|
||||||
|
!isHorizontal ? center[0] : snapPoint[0],
|
||||||
|
isHorizontal ? center[1] : snapPoint[1],
|
||||||
|
);
|
||||||
|
const anotherIntersector = lineSegment(
|
||||||
|
anotherPoint,
|
||||||
|
pointFromVector(
|
||||||
|
vectorScale(
|
||||||
|
vectorNormalize(vectorFromPoint(snapPoint, anotherPoint)),
|
||||||
|
Math.max(bindableElement.width, bindableElement.height) * 2,
|
||||||
|
),
|
||||||
|
anotherPoint,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
intersection = intersectElementWithLineSegment(
|
||||||
|
bindableElement,
|
||||||
|
elementsMap,
|
||||||
|
anotherIntersector,
|
||||||
|
FIXED_BINDING_DISTANCE,
|
||||||
|
).sort(pointDistanceSq)[0];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
intersection = intersectElementWithLineSegment(
|
intersection = intersectElementWithLineSegment(
|
||||||
bindableElement,
|
bindableElement,
|
||||||
|
Reference in New Issue
Block a user