adjust camera distance for portrait mode in mining game

This commit is contained in:
2025-11-25 06:50:56 +11:00
parent 45f14a5a01
commit 20ab323ae9

View File

@@ -1726,7 +1726,12 @@ document.addEventListener('DOMContentLoaded', () => {
const aspect = width / height;
// Dynamic view size based on grid size
const d = 5 + (upgrades.grid_size || 0);
let d = 5 + (upgrades.grid_size || 0);
// Adjust for portrait mode to ensure width fits
if (aspect < 1) {
d = d / aspect;
}
camera.left = -d * aspect;
camera.right = d * aspect;