From 6ba33701a570ef3dc25a0621f573d4a01a5a08a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E9=B9=8F?= <2916022834@qq.com> Date: Thu, 25 Sep 2025 14:01:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=94=BB=E5=B8=83=E6=89=93?= =?UTF-8?q?=E5=BC=80=E5=9B=BE=E7=89=87=E5=AF=BC=E5=87=BA=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=88=86=E8=BE=A8=E7=8E=87=E4=B8=8D=E5=80=BC=E4=B8=80=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/Canvas/CanvasEditor/index.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/component/Canvas/CanvasEditor/index.vue b/src/component/Canvas/CanvasEditor/index.vue index 0e4b7844..aa90942e 100644 --- a/src/component/Canvas/CanvasEditor/index.vue +++ b/src/component/Canvas/CanvasEditor/index.vue @@ -461,7 +461,9 @@ onMounted(async () => { const height = canvasManager.height; const cwidth = props.config.width; const cheight = props.config.height; - setZoom(Math.min(width/cwidth,height/cheight)); // 设置画布缩放 + let zoom = Math.min(1,width/cwidth,height/cheight); + if(zoom < 1) zoom -= 0.05; + setZoom(zoom); // 设置画布缩放 } }); @@ -531,7 +533,7 @@ function resetZoom() { function setZoom(zoom) { setTimeout(()=>{ if (!canvasManager) return; - const newZoom = Math.max(zoom / 1.1, 0.1); // 减少10%,最小0.1倍 + const newZoom = Math.max(zoom, 0.1); // 减少10%,最小0.1倍 // 使用画布中心作为缩放点 const centerPoint = { x: canvasManager.canvas.width / 2,