Просмотр исходного кода

Canvas2D: fix a bug when trackNode was used inside a Canvas' children creation statement

nockawa 8 лет назад
Родитель
Сommit
16a59d3792
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);