mirror of
https://github.com/litruv/lit.ruv.wtf.git
synced 2026-07-24 02:36:02 +10:00
adjust camera distance for portrait mode in mining game
This commit is contained in:
@@ -1726,7 +1726,12 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
const aspect = width / height;
|
const aspect = width / height;
|
||||||
// Dynamic view size based on grid size
|
// 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.left = -d * aspect;
|
||||||
camera.right = d * aspect;
|
camera.right = d * aspect;
|
||||||
|
|||||||
Reference in New Issue
Block a user