Browse Source

Merge pull request #1307 from nockawa/master

Canvas 2D
Loïc Baumann 9 năm trước cách đây
mục cha
commit
616e7e62e9
2 tập tin đã thay đổi với 2 bổ sung1 xóa
  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);
             }