Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
ale
2025-11-12 18:11:45 +01:00
padre 860fa444b0
commit 1e7bf8fb41

Ver fichero

@@ -68,7 +68,12 @@ export function GameBoard({ placedTiles, width = 1200, height = 700, className =
const isMobile = window.innerWidth < 640; const isMobile = window.innerWidth < 640;
const zoomX = canvasSize.width / contentWidth; const zoomX = canvasSize.width / contentWidth;
const zoomY = canvasSize.height / contentHeight; 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 // Calculate center position
const centerX = (minX + maxX) / 2; const centerX = (minX + maxX) / 2;