From 35468d8e203b36427f6fb9c6c97f1f8d218e3da1 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 14 Oct 2024 14:28:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E7=BC=A9=E6=94=BE=E6=AF=94?= =?UTF-8?q?=E4=BE=8B=E4=B8=8B=EF=BC=8C=E7=BC=96=E8=BE=91=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E6=95=B0=E5=AD=97=E5=A2=9E=E5=8A=A0=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E8=B7=B3=E8=B7=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/utils/DeShortcutKey.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/utils/DeShortcutKey.ts b/core/core-frontend/src/utils/DeShortcutKey.ts index b15c514134..1a383f99cc 100644 --- a/core/core-frontend/src/utils/DeShortcutKey.ts +++ b/core/core-frontend/src/utils/DeShortcutKey.ts @@ -175,17 +175,18 @@ function paste() { function move(keyCode) { if (curComponent.value) { + const scale = dvMainStore.canvasStyleData.scale / 100 if (keyCode === leftKey) { - curComponent.value.style.left = --curComponent.value.style.left + curComponent.value.style.left = curComponent.value.style.left - scale groupAreaAdaptor(-1, 0) } else if (keyCode === rightKey) { - curComponent.value.style.left = ++curComponent.value.style.left + curComponent.value.style.left = curComponent.value.style.left + scale groupAreaAdaptor(1, 0) } else if (keyCode === upKey) { - curComponent.value.style.top = --curComponent.value.style.top + curComponent.value.style.top = curComponent.value.style.top - scale groupAreaAdaptor(0, -1) } else if (keyCode === downKey) { - curComponent.value.style.top = ++curComponent.value.style.top + curComponent.value.style.top = curComponent.value.style.top + scale groupAreaAdaptor(0, 1) } snapshotStore.recordSnapshotCache('key-move')