fix: 禁止竖向文本通过位置面板修改宽度

This commit is contained in:
pipipi-pikachu 2022-09-03 10:00:43 +08:00
parent fef42b770c
commit b8d108d574

View File

@ -68,6 +68,7 @@
:min="minSize" :min="minSize"
:max="1500" :max="1500"
:step="5" :step="5"
:disabled="isVerticalText"
:value="width" :value="width"
@change="value => updateWidth(value as number)" @change="value => updateWidth(value as number)"
style="flex: 4;" style="flex: 4;"
@ -85,7 +86,7 @@
:min="minSize" :min="minSize"
:max="800" :max="800"
:step="5" :step="5"
:disabled="handleElement!.type === 'text'" :disabled="isHorizontalText"
:value="height" :value="height"
@change="value => updateHeight(value as number)" @change="value => updateHeight(value as number)"
style="flex: 4;" style="flex: 4;"
@ -158,6 +159,13 @@ const minSize = computed(() => {
return MIN_SIZE[handleElement.value.type] || 20 return MIN_SIZE[handleElement.value.type] || 20
}) })
const isHorizontalText = computed(() => {
return handleElement.value?.type === 'text' && !handleElement.value.vertical
})
const isVerticalText = computed(() => {
return handleElement.value?.type === 'text' && handleElement.value.vertical
})
watch(handleElement, () => { watch(handleElement, () => {
if (!handleElement.value) return if (!handleElement.value) return