MCPcopy Create free account
hub / github.com/microsoft/SandDance / intersectRule

Function intersectRule

docs/app/js/sanddance-app.js:122208–122211  ·  view source on GitHub ↗
(item, box)

Source from the content-addressed store, hash-verified

122206 return box.intersects(b.set(x23, y22, x23 + w4, y22 + h9));
122207}
122208function intersectRule(item, box) {
122209 const x24 = item.x || 0, y23 = item.y || 0, x2 = item.x2 != null ? item.x2 : x24, y2 = item.y2 != null ? item.y2 : y23;
122210 return intersectBoxLine(box, x24, y23, x2, y2);
122211}
122212function intersectBoxLine(box, x25, y24, u, v) {
122213 const { x1 , y1 , x2 , y2 } = box, dx = u - x25, dy = v - y24;
122214 let t0 = 0, t1 = 1, p, q, r, e;

Callers

nothing calls this directly

Calls 1

intersectBoxLineFunction · 0.70

Tested by

no test coverage detected