From 9eff1fb3fca1eb531ca95fd573ff67b02a1c74ab Mon Sep 17 00:00:00 2001 From: yzz2333 <65339647+yzz2333@users.noreply.github.com> Date: Sat, 20 Apr 2024 01:08:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=AF=94?= =?UTF-8?q?=E4=BE=8B=E6=94=B9=E5=8F=98=E5=90=8E=E6=92=A4=E9=94=80=E5=86=85?= =?UTF-8?q?=E9=83=A8=E5=85=83=E7=B4=A0=E9=94=99=E4=B9=B1=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=81=E6=96=87=E5=AD=97=E6=8D=A2=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Toolbar.vue | 1 + src/custom-component/VText/Component.vue | 4 +- src/custom-component/common/CommonAttr.vue | 30 +++++++++- src/custom-component/component-list.js | 15 ++--- src/store/index.js | 9 ++- src/store/snapshot.js | 12 ++-- src/utils/changeComponentsSizeWithScale.js | 67 +++++++++++++--------- 7 files changed, 93 insertions(+), 45 deletions(-) diff --git a/src/components/Toolbar.vue b/src/components/Toolbar.vue index c75cee2..d634c09 100644 --- a/src/components/Toolbar.vue +++ b/src/components/Toolbar.vue @@ -134,6 +134,7 @@ export default { }, handleScaleChange() { clearTimeout(this.timer) + this.$store.commit('setLastScale', this.scale) this.timer = setTimeout(() => { // 画布比例设一个最小值,不能为 0 // eslint-disable-next-line no-bitwise diff --git a/src/custom-component/VText/Component.vue b/src/custom-component/VText/Component.vue index 90fdf86..c95d522 100644 --- a/src/custom-component/VText/Component.vue +++ b/src/custom-component/VText/Component.vue @@ -12,7 +12,7 @@ :contenteditable="canEdit" :class="{ 'can-edit': canEdit }" tabindex="0" - :style="{ verticalAlign: element.style.verticalAlign }" + :style="{ verticalAlign: element.style.verticalAlign, padding:element.style.padding + 'px' }" @dblclick="setEdit" @paste="clearStyle" @mousedown="handleMousedown" @@ -22,7 +22,7 @@ >
-
+
diff --git a/src/custom-component/common/CommonAttr.vue b/src/custom-component/common/CommonAttr.vue index da9be01..517ae70 100644 --- a/src/custom-component/common/CommonAttr.vue +++ b/src/custom-component/common/CommonAttr.vue @@ -1,5 +1,5 @@