mirror of
https://github.com/litruv/lit.ruv.wtf.git
synced 2026-11-28 09:25:46 +11:00
adjust camera distance for portrait mode in mining game
This commit is contained in:
1 parent
45f14a5a01
commit
20ab323ae9
1 file changed
+6
-1
+6
-1
@@ -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