update board dimensions after window resize

This commit is contained in:
Gator
2022-12-04 18:14:57 +01:00
parent 2c69840d6f
commit 5c21fb2ac3
4 changed files with 43 additions and 17 deletions

View File

@ -37,6 +37,14 @@ export const globalStore = defineStore("globalStore", {
};
},
actions: {
setBoardWidth() {
this.boardWidth = Math.floor(this.canvasWidth / this.cellProperties.size);
},
setBoardHeight() {
this.boardHeight = Math.floor(
this.canvasHeight / this.cellProperties.size
);
},
toggleDraw1d() {
this.draw1d = true;
},