Improve pathfinder sizing

This commit is contained in:
Dejvino
2023-08-30 19:39:31 +02:00
parent f289dd23d1
commit 9bd32c1032
3 changed files with 6 additions and 7 deletions
-1
View File
@@ -1,6 +1,5 @@
.main-grid-container{
height: 100%;
display: flex;
flex-flow: row nowrap;
justify-content: center;
+2 -2
View File
@@ -83,7 +83,7 @@ function spawnPathfinder(root) {
let algo_select = root.getElementsByClassName("algo-select")[0];
let maze_algo_select = root.getElementsByClassName("maze-algo-select")[0];
const window_y = body.scrollHeight - navbar_HTML.scrollHeight;
const window_y = (body.scrollHeight - navbar_HTML.scrollHeight);
const window_x = body.scrollWidth;
let horizontal_cells;
@@ -101,7 +101,7 @@ function spawnPathfinder(root) {
vertical_cells = Math.floor(window_y / 35);
horizontal_cells = Math.floor( (window_x - horizontal_cells) /35);
vertical_cells = Math.floor( (window_y - vertical_cells) / 35);
vertical_cells = Math.floor( (window_y - vertical_cells) / 35 * 0.9);
grid_HTML.style.width = `${horizontal_cells * 35}px`;
grid_HTML.style.height = `${vertical_cells * 30}px`;