Skip to content

Commit

Permalink
fix change mipmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
yanOO1497 committed Sep 6, 2023
1 parent ad62e8c commit 3d9ac31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions editor/inspector/assets/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ exports.methods = {
meta.subMetas[targetSubMetaKey].userData.mipfilter = 'nearest';
}
});
} else if (this.meta.type === 'sprite-frame') {
} else if (this.meta.userData.type === 'sprite-frame') {
// any -> sprite,disabled mipmaps
this.metaList.forEach((meta) => {
meta.subMetas[targetSubMetaKey].userData.mipfilter = 'none';
Expand Down Expand Up @@ -327,9 +327,9 @@ exports.methods = {
});
}
}
if (this.originImageType === 'sprite-frame' || this.meta.type === 'sprite-frame') {
const targetSubMetaKey = Object.keys(this.meta.subMetas).find((key) => this.meta.subMetas[key].importer === imageTypeToImporter[this.meta.userData.type])
// sprite -> any : mipfilter = 'nearest'
if (this.originImageType === 'sprite-frame' || this.meta.userData.type === 'sprite-frame') {
const targetImporter = this.meta.userData.type === 'sprite-frame' ? 'texture' : this.meta.userData.type;
const targetSubMetaKey = Object.keys(this.meta.subMetas).find((key) => this.meta.subMetas[key].importer === imageTypeToImporter[targetImporter])
this.changeMipFilter(targetSubMetaKey);
}
}
Expand Down

0 comments on commit 3d9ac31

Please sign in to comment.