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

Function pickVisit

docs/app/js/sanddance-app.js:122330–122344  ·  view source on GitHub ↗
(scene, visitor)

Source from the content-addressed store, hash-verified

122328 for(i = 0, n = items.length; i < n; ++i)visitor(items[i]);
122329}
122330function pickVisit(scene, visitor) {
122331 var items = scene.items, hit1, i;
122332 if (!items || !items.length) return null;
122333 const zitems = zorder(scene);
122334 if (zitems && zitems.length) items = zitems;
122335 for(i = items.length; --i >= 0;){
122336 if (hit1 = visitor(items[i])) return hit1;
122337 }
122338 if (items === zitems) {
122339 for(items = scene.items, i = items.length; --i >= 0;)if (!items[i].zindex) {
122340 if (hit1 = visitor(items[i])) return hit1;
122341 }
122342 }
122343 return null;
122344}
122345function drawAll(path4) {
122346 return function(context30, scene, bounds3) {
122347 visit(scene, (item)=>{

Callers 2

pick$1Function · 0.70
pickFunction · 0.70

Calls 1

zorderFunction · 0.70

Tested by

no test coverage detected