浏览代码

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

nockawa 9 年之前
父节点
当前提交
c07204247e
共有 1 个文件被更改,包括 7 次插入6 次删除
  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;