| 122307 | return a.zindex - b11.zindex || a.index - b11.index; |
| 122308 | } |
| 122309 | function 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 | } |
| 122320 | function visit(scene, visitor) { |
| 122321 | var items = scene.items, i, n; |
| 122322 | if (!items || !items.length) return; |