From 1e7bf8fb41c073ba1201201eba52c36ef7518eae Mon Sep 17 00:00:00 2001 From: ale Date: Wed, 12 Nov 2025 18:11:45 +0100 Subject: [PATCH] zoom canvas Signed-off-by: ale --- components/GameBoard.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/GameBoard.tsx b/components/GameBoard.tsx index ce67536..bef9445 100644 --- a/components/GameBoard.tsx +++ b/components/GameBoard.tsx @@ -68,7 +68,12 @@ export function GameBoard({ placedTiles, width = 1200, height = 700, className = const isMobile = window.innerWidth < 640; const zoomX = canvasSize.width / contentWidth; const zoomY = canvasSize.height / contentHeight; - const newZoom = Math.min(zoomX, zoomY, isMobile ? 1 : 1.5); // Limit max zoom + + // Set zoom limits: minimum 0.4 for readability, maximum 1.5 for desktop / 1 for mobile + const minZoom = isMobile ? 0.5 : 0.4; + const maxZoom = isMobile ? 1 : 1.5; + const calculatedZoom = Math.min(zoomX, zoomY); + const newZoom = Math.max(minZoom, Math.min(calculatedZoom, maxZoom)); // Calculate center position const centerX = (minX + maxX) / 2;