Sfoglia il codice sorgente

Update babylon.node.ts

Revising the getChildren (again?), for some reason this was rewritten.
Raanan Weber 9 anni fa
parent
commit
c2e1ac238e
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/babylon.node.ts

+ 1 - 1
src/babylon.node.ts

@@ -186,7 +186,7 @@
         public _getDescendants(list: Node[], results: Node[], directDecendantsOnly: boolean = false, predicate?: (node: Node) => boolean): void {
             for (var index = 0; index < list.length; index++) {
                 var item = list[index];
-                if (((directDecendantsOnly && item.parent === this) || (!directDecendantsOnly && item.isDescendantOf(this))) && (predicate === null || predicate(item))) {
+                if (((directDecendantsOnly && item.parent === this) || (!directDecendantsOnly && item.isDescendantOf(this))) && (!predicate || predicate(item))) {
                     results.push(item);
                 }
             }