ソースを参照

Merge pull request #1659 from nockawa/trackedNode

Canvas2D: fix a bug when trackNode was used inside a Canvas' children…
Loïc Baumann 8 年 前
コミット
9af01afe32
1 ファイル変更6 行追加1 行削除
  1. 6 1
      canvas2D/src/Engine/babylon.canvas2d.ts

+ 6 - 1
canvas2D/src/Engine/babylon.canvas2d.ts

@@ -168,7 +168,9 @@
             this._renderingSize = new Size(0, 0);
             this._designSize = settings.designSize || null;
             this._designUseHorizAxis = settings.designUseHorizAxis === true;
-            this._trackedGroups = new Array<Group2D>();
+            if (!this._trackedGroups) {
+                this._trackedGroups = new Array<Group2D>();
+            }
             this._maxAdaptiveWorldSpaceCanvasSize = null;
             this._groupCacheMaps = new StringDictionary<MapTexture[]>();
 
@@ -1577,6 +1579,9 @@
             if (group._isFlagSet(SmartPropertyPrim.flagTrackedGroup)) {
                 return;
             }
+            if (!this._trackedGroups) {
+                this._trackedGroups = new Array<Group2D>();
+            }
             this._trackedGroups.push(group);
 
             group._setFlags(SmartPropertyPrim.flagTrackedGroup);