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 11, 2023
1 parent a95ef67 commit b1ba0d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion editor/i18n/zh/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ module.exports = {
},
spriteFrame: {
label: '精灵帧资源(SpriteFrame)',
description: 'SpriteFrame 是 UI 渲染基础图形的容器。其本身管理图像的裁剪和九宫格信息,默认持有一个与其同级的 Texture2D 资源引用',
packable: 'Packable',
packableTip: '是否参与动态合图或者自动图集的构建处理',
rotated: 'Rotated',
Expand Down
10 changes: 5 additions & 5 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,10 +327,10 @@ 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'
this.changeMipFilter(targetSubMetaKey);
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])
targetSubMetaKey && this.changeMipFilter(targetSubMetaKey);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion editor/inspector/assets/texture/texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ const Elements = {
// 根据 wrapModeSelect 组合值同步相应的 wrapModeS/wrapModeT 到 userData
const value = event.target.value;
// 临时记录用户的修改配置
Editor.Profile.setConfig('inspector', `${this.meta.uuid}.texture.wrapMode`, 'Clamp', 'default');
Editor.Profile.setConfig('inspector', `${this.meta.uuid}.texture.wrapMode`, value, 'default');
if (ModeMap.wrap[value]) {
panel.userDataList.forEach((userData) => {
const data = ModeMap.wrap[value];
Expand Down

0 comments on commit b1ba0d1

Please sign in to comment.