fix: 渐变设置面板在切换操作对象后报错

This commit is contained in:
zxc 2024-08-11 14:17:44 +08:00
parent dffb6235c4
commit 0cca0d6c57
2 changed files with 5 additions and 1 deletions

View File

@ -196,7 +196,10 @@ const updateFillType = (type: 'gradient' | 'fill') => {
slidesStore.removeElementProps({ id: handleElementId.value, propName: 'gradient' })
addHistorySnapshot()
}
else updateElement({ gradient: gradient.value })
else {
currentGradientIndex.value = 0
updateElement({ gradient: gradient.value })
}
}
//

View File

@ -388,6 +388,7 @@ const updateBackgroundType = (type: SlideBackgroundType) => {
rotate: 0,
},
}
currentGradientIndex.value = 0
slidesStore.updateSlide({ background: newBackground })
}
addHistorySnapshot()