浏览代码

Merge pull request #1308 from RaananW/worldcanvas-renderGroup-fix

Making sure parent exists before providing its rendergroup.
Loïc Baumann 9 年之前
父节点
当前提交
b9d6f1c196
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Canvas2d/babylon.group2d.ts

+ 1 - 1
src/Canvas2d/babylon.group2d.ts

@@ -803,7 +803,7 @@
 
             if (!rd._cacheNode) {
                 // Check if we have to allocate a rendering zone in the global cache texture
-                var res = this.owner._allocateGroupCache(this, this.parent.renderGroup, curWidth ? new Size(curWidth, curHeight) : null, rd._useMipMap, rd._anisotropicLevel);
+                var res = this.owner._allocateGroupCache(this, this.parent && this.parent.renderGroup, curWidth ? new Size(curWidth, curHeight) : null, rd._useMipMap, rd._anisotropicLevel);
                 rd._cacheNode = res.node;
                 rd._cacheTexture = res.texture;
                 rd._cacheRenderSprite = res.sprite;