Explorar o código

Fix bug when in non-Instanced Array mode when no prim are rendered but the GroupInfo exists...

nockawa %!s(int64=9) %!d(string=hai) anos
pai
achega
c07204247e
Modificáronse 1 ficheiros con 7 adicións e 6 borrados
  1. 7 6
      src/Canvas2d/babylon.group2d.ts

+ 7 - 6
src/Canvas2d/babylon.group2d.ts

@@ -672,13 +672,14 @@
             else {
                 context.partDataStartIndex = 0;
 
-                // Find the first valid object to get the count
-                let i = 0;
-                while (!context.groupInfoPartData[i]) {
-                    i++;
+                if (context.groupInfoPartData.length > 0) {
+                    // Find the first valid object to get the count
+                    let i = 0;
+                    while (!context.groupInfoPartData[i]) {
+                        i++;
+                    }
+                    context.partDataEndIndex = context.groupInfoPartData[i]._partData.usedElementCount;
                 }
-
-                context.partDataEndIndex = context.groupInfoPartData[i]._partData.usedElementCount;
             }
 
             return renderCount;