mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
Fix bug when reset ImageAsset with raw data (#5933)
This commit is contained in:
committed by
pandamicro
parent
5de46c1ede
commit
65254f2026
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user