main #2

Merged
sageTheDm merged 2 commits from interstellar_development/interstellar_website:main into main 2025-01-04 22:41:03 +01:00

View file

@ -139,10 +139,10 @@ class Minesweeper {
} }
drawField() { drawField() {
canvas.width = window.innerWidth; const squareWidth = window.innerWidth / (this.field.length + 4);
canvas.height = window.innerHeight; const squareHeight = window.innerHeight / (this.field[0].length + 4);
const squareWidth = canvas.width / (this.field.length + 4); canvas.width = squareWidth * this.field.length;
const squareHeight = canvas.height / (this.field[0].length + 4); canvas.height = squareHeight * this.field[0].length;
squareHeight > squareWidth ? this.size = squareWidth : this.size = squareHeight; squareHeight > squareWidth ? this.size = squareWidth : this.size = squareHeight;
const offsetX = (canvas.width - (this.field.length * this.size)) / 2; const offsetX = (canvas.width - (this.field.length * this.size)) / 2;