Forráskód Böngészése

Fix not required traversal for GUI

David Catuhe 7 éve
szülő
commit
20e678b930

+ 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;