Fix bug when reset ImageAsset with raw data (#5933)

This commit is contained in:
Leslie Leigh (李的序)
2019-12-20 16:05:47 +08:00
committed by pandamicro
parent 5de46c1ede
commit 65254f2026
+2 -2
View File
@@ -165,7 +165,7 @@ export class ImageAsset extends Asset {
}
if (nativeAsset !== undefined) {
this._nativeAsset = nativeAsset;
this.reset(nativeAsset);
}
}
@@ -177,7 +177,7 @@ export class ImageAsset extends Asset {
if (!(data instanceof HTMLElement)) {
// this._nativeData = Object.create(data);
this._nativeData = data;
this._nativeData.format = this._format;
this._format = data.format;
this._onDataComplete();
} else {
this._nativeData = data;