mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
update change image type (#15439)
This commit is contained in:
@@ -203,6 +203,10 @@ const Elements = {
|
||||
};
|
||||
|
||||
exports.methods = {
|
||||
apply() {
|
||||
// if the image type changes between sprite-frame
|
||||
this.spriteFrameChange = this.checkSpriteFrameChange(this.originImageType, this.meta.userData.type);
|
||||
},
|
||||
updatePanel() {
|
||||
this.setPanel(this.$.panelSection, this.meta.userData.type);
|
||||
|
||||
@@ -370,15 +374,14 @@ exports.update = function(assetList, metaList) {
|
||||
this.asset = assetList[0];
|
||||
this.meta = metaList[0];
|
||||
|
||||
if (this.originMetaList && !this.asset.readonly) {
|
||||
// if the image type changes between sprite-frame
|
||||
const spriteFrameChange = this.checkSpriteFrameChange(this.originMetaList[0].userData.type, this.meta.userData.type);
|
||||
this.handleTypeChange(spriteFrameChange, this.meta.userData.type);
|
||||
if (this.spriteFrameChange && this.originMetaList && !this.asset.readonly) {
|
||||
this.handleTypeChange(this.spriteFrameChange, this.meta.userData.type);
|
||||
// same as panel handle
|
||||
if (this.meta.userData.type === 'sprite-frame') {
|
||||
this.handleTypeChange(spriteFrameChange, 'texture');
|
||||
this.handleTypeChange(this.spriteFrameChange, 'texture');
|
||||
}
|
||||
}
|
||||
this.originImageType = this.meta.userData.type;
|
||||
// change originMetaList
|
||||
this.originMetaList = JSON.parse(JSON.stringify(this.metaList));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user