chore: Logic for measurement

This commit is contained in:
Mark Tolmacs
2025-09-16 17:05:30 +02:00
parent 55115d2ee4
commit f2f5168355

View File

@@ -1273,18 +1273,11 @@ 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 = // TODO: 1. Focus point -> focus point segment (fallback to arrow endpoint if not bound)
otherBounds && // 2. Check the intersection points for both elements
doBoundsIntersect( // 3. Measure distance between intersection points
[ const isIntersecting = otherBounds && doBoundsIntersect(bounds, otherBounds);
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 =