MCPcopy
hub / github.com/microsoft/SandDance / intersectGroup

Function intersectGroup

docs/app/js/sanddance-app.js:124842–124856  ·  view source on GitHub ↗
(group9, box, filter, hits)

Source from the content-addressed store, hash-verified

124840 return mark.bounds && box.intersects(mark.bounds) && (mark.marktype === "group" || mark.interactive !== false && (!filter || filter(mark)));
124841}
124842function intersectGroup(group9, box, filter, hits) {
124843 // test intersect against group
124844 // skip groups by default unless filter says otherwise
124845 if (filter && filter(group9.mark) && intersectItem(group9, box, Marks.group.isect)) hits.push(group9);
124846 // recursively test children marks
124847 // translate box to group coordinate space
124848 const marks = group9.items, n = marks && marks.length;
124849 if (n) {
124850 const x48 = group9.x || 0, y46 = group9.y || 0;
124851 box.translate(-x48, -y46);
124852 for(let i = 0; i < n; ++i)intersectMark(marks[i], box, filter, hits);
124853 box.translate(x48, y46);
124854 }
124855 return hits;
124856}
124857function intersectItem(item, box, test) {
124858 // test bounds enclosure, bounds intersection, then detailed test
124859 const bounds21 = item.bounds;

Callers 2

intersectFunction · 0.70
intersectMarkFunction · 0.70

Calls 4

filterFunction · 0.70
intersectItemFunction · 0.70
intersectMarkFunction · 0.70
translateMethod · 0.45

Tested by

no test coverage detected