소스 검색

Better fix

Popov72 5 년 전
부모
커밋
f9939da61a
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      gui/src/2D/controls/image.ts

+ 1 - 1
gui/src/2D/controls/image.ts

@@ -384,6 +384,7 @@ export class Image extends Control {
     }
 
     private _onImageLoaded(): void {
+        this._imageDataCache.data = null;
         this._imageWidth = this._domImage.width;
         this._imageHeight = this._domImage.height;
         this._loaded = true;
@@ -470,7 +471,6 @@ export class Image extends Control {
         this._domImage = document.createElement("img");
 
         this._domImage.onload = () => {
-            this._imageDataCache.data = null;
             this._onImageLoaded();
         };
         if (value) {