FEAT: No binding to frame cutout

This commit is contained in:
Mark Tolmacs
2025-10-05 20:46:02 +02:00
parent 9551f2f8fb
commit 539e805e91
4 changed files with 122 additions and 1 deletions

View File

@@ -36,6 +36,7 @@ import {
getCubicBezierCurveBound,
getDiamondPoints,
getElementBounds,
pointInsideBounds,
} from "./bounds";
import {
hasBoundTextElement,
@@ -226,6 +227,20 @@ const bindingBorderTest = (
return false;
}
// If the element is inside a frame, we should clip the element
if (element.frameId) {
const enclosingFrame = elementsMap.get(element.frameId);
if (enclosingFrame && isFrameLikeElement(enclosingFrame)) {
const enclosingFrameBounds = getElementBounds(
enclosingFrame,
elementsMap,
);
if (!pointInsideBounds(p, enclosingFrameBounds)) {
return false;
}
}
}
// Do the intersection test against the element since it's close enough
const intersections = intersectElementWithLineSegment(
element,