fix: prefer width-first workbench scaling
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user