Commit 62edb4e2 authored by zhengke's avatar zhengke

修复 横竖尺寸

parent 839b2d0b
......@@ -374,8 +374,8 @@ const createFrameElement = (url: string) => {
width: 800,
height: 480,
rotate: 0,
left: (VIEWPORT_SIZE - 800) / 2,
top: (VIEWPORT_SIZE * viewportRatio.value - 480) / 2,
left: (VIEWPORT_SIZE.Value - 800) / 2,
top: (VIEWPORT_SIZE.Value * viewportRatio.value - 480) / 2,
url,
})
}
......
......@@ -83,6 +83,7 @@ import AliyunUpload from '@/utils/upload/aliyun'
import { useFontStore,useScreenStore } from '@/store'
import { CustomerFonts } from '@/store/font'
import { injectKeyDataSource,injectKeyTemplate } from '@/types/injectKey'
import { VIEWPORT_SIZE, VIEWPORT_VER_SIZE } from '@/configs/canvas'
const props = defineProps({
visible:{
......@@ -125,8 +126,13 @@ const handleChange: UploadProps['onChange'] = (uploadFile, uploadFiles) => {
queryObj.value.Width = DrawingBoardSize.Width
queryObj.value.Height = DrawingBoardSize.Height
queryObj.value.TempType = queryObj.value.Width>queryObj.value.Height?1:2
VIEWPORT_SIZE.Value = queryObj.value.Height
VIEWPORT_VER_SIZE.Value = queryObj.value.Width
let viewportRatio = queryObj.value.Height/queryObj.value.Width
useSlidesStore().setViewportRatio(viewportRatio)
}else {
VIEWPORT_SIZE.Value = 1754
VIEWPORT_VER_SIZE.Value = 1240
}
fonts.value = getFonts(psd)
if(fonts.value){
......
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