소스 검색

Perf improvment - step 1

David Catuhe 6 년 전
부모
커밋
28b96e2918
2개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      gui/src/2D/advancedDynamicTexture.ts
  2. 1 0
      gui/src/2D/controls/control.ts

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

@@ -574,6 +574,8 @@ export class AdvancedDynamicTexture extends DynamicTexture {
         context.strokeStyle = "white";
         var measure = new Measure(0, 0, renderWidth, renderHeight);
         this._rootContainer._layout(measure, context);
+        this._isDirty = false; // Restoring the dirty state that could have been set by controls during layout processing
+
         this._rootContainer._render(context);
     }
 

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

@@ -1342,6 +1342,7 @@ export class Control {
     /** @hidden */
     public _render(context: CanvasRenderingContext2D): boolean {
         if (!this.isVisible || this.notRenderable || this._isClipped) {
+            this._isDirty = false;
             return false;
         }
         context.save();