From 39dd88ded95d8d018e7e0ce8ccadb5384bff0303 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 28 Aug 2024 11:34:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E3=80=81=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=94=BB=E5=B8=83=E7=BC=A9=E6=94=BE=E5=81=8F=E7=A6=BB=E8=BE=83?= =?UTF-8?q?=E5=A4=A7=E6=97=B6Tab=E8=A1=A8=E5=A4=B4=E9=9D=9E=E6=BF=80?= =?UTF-8?q?=E6=B4=BB=E5=AD=97=E4=BD=93=E5=92=8C=E9=A2=84=E8=AE=BE=E5=80=BC?= =?UTF-8?q?=E5=81=8F=E7=A6=BB=E8=BE=83=E5=A4=A7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/utils/changeComponentsSizeWithScale.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/utils/changeComponentsSizeWithScale.ts b/core/core-frontend/src/utils/changeComponentsSizeWithScale.ts index 2efb7ed61e..0e4100057e 100644 --- a/core/core-frontend/src/utils/changeComponentsSizeWithScale.ts +++ b/core/core-frontend/src/utils/changeComponentsSizeWithScale.ts @@ -7,9 +7,17 @@ import { groupSizeStyleAdaptor } from '@/utils/style' const dvMainStore = dvMainStoreWithOut() const { componentData, curComponentIndex, canvasStyleData } = storeToRefs(dvMainStore) -const needToChangeAttrs = ['top', 'left', 'width', 'height', 'fontSize', 'letterSpacing'] +const needToChangeAttrs = [ + 'top', + 'left', + 'width', + 'height', + 'fontSize', + 'activeFontSize', + 'letterSpacing' +] const needToChangeDirectionAttrs = { - width: ['left', 'width', 'fontSize', 'letterSpacing'], + width: ['left', 'width', 'fontSize', 'activeFontSize', 'letterSpacing'], height: ['top', 'height'] } @@ -26,7 +34,7 @@ export function changeComponentsSizeWithScale(scale, changeAttrs = needToChangeA componentDataCopy.forEach(component => { Object.keys(component.style).forEach(key => { if (changeAttrs.includes(key)) { - if (key === 'fontSize' && component.style[key] === '') return + if (['fontSize', 'activeFontSize'].includes(key) && component.style[key] === '') return // 根据原来的比例获取样式原来的尺寸 // 再用原来的尺寸 * 现在的比例得出新的尺寸 component.style[key] = format(