Cell size based resize fix

This commit is contained in:
M4YX0R
2021-12-11 11:06:21 +03:00
parent 8fcf5f2251
commit 95cf6b90b4

View File

@@ -154,9 +154,9 @@ class WorldEnvironment extends Environment{
resizeFillWindow(cell_size) {
this.renderer.cell_size = cell_size;
this.renderer.fillWindow('env');
var cols = Math.ceil(this.renderer.width / cell_size);
var rows = Math.ceil(this.renderer.height / cell_size);
this.grid_map.resize(cols, rows, cell_size);
this.num_cols = Math.ceil(this.renderer.width / cell_size);
this.num_rows = Math.ceil(this.renderer.height / cell_size);
this.grid_map.resize(this.num_cols, this.num_rows, cell_size);
}
}