浏览代码

Canvas 2D

Fix TOPLEVELGROUPS cached render mode issues
nockawa 9 年之前
父节点
当前提交
95d50bd54f
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 1 1
      src/Canvas2d/babylon.group2d.ts
  2. 1 0
      src/Canvas2d/babylon.prim2dBase.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.renderGroup, curWidth ? new Size(curWidth, curHeight) : null, rd._useMipMap, rd._anisotropicLevel);
+                var res = this.owner._allocateGroupCache(this, 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;

+ 1 - 0
src/Canvas2d/babylon.prim2dBase.ts

@@ -1406,6 +1406,7 @@
             // If the parent is given, initialize the hierarchy/owner related data
             if (parent != null) {
                 parent.addChild(this);
+                this._hierarchyDepth = parent._hierarchyDepth + 1;
                 this._patchHierarchy(parent.owner);
             }