fix: prefer width-first workbench scaling

This commit is contained in:
2026-05-20 18:58:31 +08:00
parent ae0526955f
commit 1d0a77b46a
3 changed files with 6 additions and 9 deletions

View File

@@ -2276,10 +2276,7 @@ export function AdRecreationBoard({
const updateBoardScale = () => {
const node = boardViewportRef.current
if (!node) return
const rawScale = Math.min(
node.clientWidth / BOARD_FRAME_WIDTH,
node.clientHeight / BOARD_FRAME_HEIGHT,
)
const rawScale = node.clientWidth / BOARD_FRAME_WIDTH
const nextScale = Math.round(clampNumber(rawScale, BOARD_MIN_SCALE, BOARD_MAX_SCALE) * 1000) / 1000
setBoardScale((current) => (Math.abs(current - nextScale) < 0.001 ? current : nextScale))
}