111
This commit is contained in:
@@ -474,7 +474,9 @@ onMounted(async () => {
|
|||||||
const height = canvasManager.height;
|
const height = canvasManager.height;
|
||||||
const cwidth = props.config.width;
|
const cwidth = props.config.width;
|
||||||
const cheight = props.config.height;
|
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) {
|
function setZoom(zoom) {
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
if (!canvasManager) return;
|
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 = {
|
const centerPoint = {
|
||||||
|
|||||||
Reference in New Issue
Block a user