This commit is contained in:
李志鹏
2025-09-25 14:12:02 +08:00
parent 396f29734c
commit 4a0ddcc0af

View File

@@ -474,7 +474,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); // 设置画布缩放
}
});
@@ -543,7 +545,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); // 最小0.1倍
// 使用画布中心作为缩放点
const centerPoint = {