瀏覽代碼

Minor tweaks

nockawa 9 年之前
父節點
當前提交
8efddc40ec
共有 2 個文件被更改,包括 7 次插入2 次删除
  1. 1 1
      src/Canvas2d/babylon.canvas2d.ts
  2. 6 1
      src/Canvas2d/babylon.group2d.ts

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

@@ -104,7 +104,7 @@
             this._primPointerInfo               = new PrimitivePointerInfo();
             this._capturedPointers              = new StringDictionary<Prim2DBase>();
             this._pickStartingPosition          = Vector2.Zero();
-            this._hierarchyLevelMaxSiblingCount = 10;
+            this._hierarchyLevelMaxSiblingCount = 50;
             this._hierarchyDepthOffset          = 0;
             this._siblingDepthOffset            = 1 / this._hierarchyLevelMaxSiblingCount;
             this._scene                         = scene;

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

@@ -788,7 +788,9 @@
                 let cur = this.parent;
                 while (cur) {
                     if (cur instanceof Group2D && cur._isRenderableGroup) {
-                        cur._renderableData._childrenRenderableGroups.push(this);
+                        if (cur._renderableData._childrenRenderableGroups.indexOf(this) === -1) {
+                            cur._renderableData._childrenRenderableGroups.push(this);
+                        }
                         break;
                     }
                     cur = cur.parent;
@@ -817,6 +819,9 @@
             this._transparentSegments = new Array<TransparentSegment>();
             this._firstChangedPrim = null;
             this._transparentListChanged = false;
+            this._cacheNode = null;
+            this._cacheTexture = null;
+            this._cacheRenderSprite = null;
         }
 
         dispose() {