Commit 6d658571 authored by zhengke's avatar zhengke

字体样式 回车事件

parent 7ed6e01f
......@@ -101,6 +101,7 @@ import ConfigService from '@/services/ConfigService'
import { VIEWPORT_SIZE, VIEWPORT_VER_SIZE } from '@/configs/canvas'
import FileService from '@/services/FileService'
import SpiderResource from '@/views/Editor/CanvasTool/SpiderResource.vue'
import type { PPTImageElement, SlideBackground } from '@/types/slides'
import FileInput from '@/components/FileInput.vue'
const showVisible = ref(true)
......@@ -150,6 +151,7 @@ const { addHistorySnapshot } = useHistorySnapshot()
const slidesStore = useSlidesStore()
const { slides, currentSlide, slideIndex, layoutSlides } = storeToRefs(slidesStore)
const { handleElement, handleElementId } = storeToRefs(mainStore)
const handleImageElement = handleElement as Ref<PPTImageElement>
const handleSizeChange = (val: number) => {
console.log(`${val} items per page`)
......@@ -218,8 +220,8 @@ const setImgs = async () => {
close()
}
if(imgType.value==2){
let width = propsDatas.value.width
let height = propsDatas.value.height
let width = handleImageElement.value.width
let height = handleImageElement.value.height
let maxWidth = VIEWPORT_SIZE,maxHeight = VIEWPORT_VER_SIZE.Value, viewportRatio = slidesStore.viewportRatio
if(viewportRatio<1){
maxWidth = VIEWPORT_VER_SIZE.Value
......@@ -245,7 +247,7 @@ const setImgs = async () => {
tempSize.height = Math.ceil(tempSize.height*ratio)
}
if(tempSize.height<height){
let ratio = height / tempSize.height
let ratio = height/tempSize.height
tempSize.width = Math.ceil(tempSize.width*ratio)
tempSize.height = Math.ceil(tempSize.height*ratio)
}
......
......@@ -40,7 +40,8 @@
class="inline-input w-50"
placeholder="例:14px"
@select="handleSelect('fontsize')"
@blur="handleSelect('fontsize')">
@blur="handleSelect('fontsize')"
@keyup.enter="handleSelect('fontsize')">
<template #suffix>
<IconAddText />
</template>
......@@ -298,7 +299,8 @@
class="inline-input w-50"
placeholder="字体行间距"
@select="handleSelect('lineHeight')"
@blur="handleSelect('lineHeight')">
@blur="handleSelect('lineHeight')"
@keyup.enter="handleSelect('lineHeight')">
<template #suffix>
<IconRowHeight />
</template>
......@@ -325,7 +327,8 @@
class="inline-input w-50"
placeholder="字体段间距"
@select="handleSelect('paragraphSpace')"
@blur="handleSelect('paragraphSpace')">
@blur="handleSelect('paragraphSpace')"
@keyup.enter="handleSelect('paragraphSpace')">
<template #suffix>
<IconVerticalSpacingBetweenItems />
</template>
......@@ -352,7 +355,8 @@
class="inline-input w-50"
placeholder="字体字间距"
@select="handleSelect('wordSpace')"
@blur="handleSelect('wordSpace')">
@blur="handleSelect('wordSpace')"
@keyup.enter="handleSelect('wordSpace')">
<template #suffix>
<IconFullwidth />
</template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment