ソースを参照

Fix not required traversal for GUI

David Catuhe 7 年 前
コミット
20e678b930
2 ファイル変更4 行追加6 行削除
  1. 0 6
      gui/src/2D/advancedDynamicTexture.ts
  2. 4 0
      gui/src/2D/controls/control.ts

+ 0 - 6
gui/src/2D/advancedDynamicTexture.ts

@@ -307,12 +307,6 @@ export class AdvancedDynamicTexture extends DynamicTexture {
      */
     public markAsDirty() {
         this._isDirty = true;
-
-        this.executeOnAllControls((control) => {
-            if (control._isFontSizeInPercentage) {
-                control._resetFontCache();
-            }
-        });
     }
 
     /**

+ 4 - 0
gui/src/2D/controls/control.ts

@@ -959,6 +959,10 @@ export class Control {
 
     /** @hidden */
     protected _applyStates(context: CanvasRenderingContext2D): void {
+        if (this._isFontSizeInPercentage) {
+            this._resetFontCache();
+        }
+
         if (this._fontSet) {
             this._prepareFont();
             this._fontSet = false;