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

Function zorder

docs/app/js/sanddance-app.js:122309–122319  ·  view source on GitHub ↗
(scene)

Source from the content-addressed store, hash-verified

122307 return a.zindex - b11.zindex || a.index - b11.index;
122308}
122309function zorder(scene) {
122310 if (!scene.zdirty) return scene.zitems;
122311 var items = scene.items, output = [], item, i, n;
122312 for(i = 0, n = items.length; i < n; ++i){
122313 item = items[i];
122314 item.index = i;
122315 if (item.zindex) output.push(item);
122316 }
122317 scene.zdirty = false;
122318 return scene.zitems = output.sort(compare);
122319}
122320function visit(scene, visitor) {
122321 var items = scene.items, i, n;
122322 if (!items || !items.length) return;

Callers 2

visitFunction · 0.70
pickVisitFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected