mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-18 06:50:31 +02:00
fix:Add intersection padding
This commit is contained in:
@@ -1273,10 +1273,18 @@ export const updateBoundPoint = (
|
|||||||
compareElementArea(bindableElement, otherBindableElement) <
|
compareElementArea(bindableElement, otherBindableElement) <
|
||||||
// if both shapes the same size, pretend the other is larger
|
// if both shapes the same size, pretend the other is larger
|
||||||
(startOrEnd === "endBinding" ? 1 : 0);
|
(startOrEnd === "endBinding" ? 1 : 0);
|
||||||
|
const boundsPadding = 30; // Effectively the "minimum arrow size" in this case
|
||||||
const isIntersecting = otherBounds && doBoundsIntersect(bounds, otherBounds);
|
const isIntersecting =
|
||||||
// const isNested =
|
otherBounds &&
|
||||||
// otherBindableElement && isBindableElementInsideOtherBindable(otherBindableElement, bindableElement);
|
doBoundsIntersect(
|
||||||
|
[
|
||||||
|
bounds[0] - boundsPadding,
|
||||||
|
bounds[1] - boundsPadding,
|
||||||
|
bounds[2] + boundsPadding,
|
||||||
|
bounds[3] + boundsPadding,
|
||||||
|
],
|
||||||
|
otherBounds,
|
||||||
|
);
|
||||||
const isNested = isIntersecting && isLargerThanOther;
|
const isNested = isIntersecting && isLargerThanOther;
|
||||||
|
|
||||||
const maybeOutlineGlobal =
|
const maybeOutlineGlobal =
|
||||||
|
Reference in New Issue
Block a user