Compare commits
	
		
			3 commits
		
	
	
		
			61fba34857
			...
			ece497e2cf
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ece497e2cf | |||
| 465ed64ba4 | |||
| 7f48a9bdc2 | 
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -139,10 +139,10 @@ class Minesweeper { | |||
|     } | ||||
| 
 | ||||
|     drawField() { | ||||
|         canvas.width = window.innerWidth; | ||||
|         canvas.height = window.innerHeight; | ||||
|         const squareWidth = canvas.width / (this.field.length + 4); | ||||
|         const squareHeight = canvas.height / (this.field[0].length + 4); | ||||
|         const squareWidth = window.innerWidth / (this.field.length + 4); | ||||
|         const squareHeight = window.innerHeight / (this.field[0].length + 4); | ||||
|         canvas.width = squareWidth * this.field.length; | ||||
|         canvas.height = squareHeight * this.field[0].length; | ||||
|         squareHeight > squareWidth ? this.size = squareWidth : this.size = squareHeight; | ||||
| 
 | ||||
|         const offsetX = (canvas.width - (this.field.length * this.size)) / 2; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue