limit max scale to 1

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 09f694c90a
commit b25033e872
2 changed files with 17 additions and 14 deletions

View File

@@ -55,7 +55,8 @@
const widthScale = width / frameDimension.width;
const heightScale = height / frameDimension.height;
el.style.transform =
`scale(${Math.min(widthScale, heightScale)})` + 'translate(-50%, -50%)';
`scale(${Math.min(widthScale, heightScale, 1)})` +
'translate(-50%, -50%)';
};
export const triggerResize = () => {