File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ class MinesweeperRound {
3232
3333 let windowGrabberHeight = document . querySelector ( ".window-header" ) . getBoundingClientRect ( ) . height ;
3434 let borderSize = getComputedStyle ( document . documentElement ) . getPropertyValue ( "--border-size" ) . split ( "px" ) [ 0 ] ;
35- // resizeCanvas(width - borderSize * 2, height - borderSize * 3);
3635
3736 if ( trF >= trC ) {
3837 cellSize = ( window . innerWidth * 0.9 - borderSize * 2 ) / ( this . width + 1 ) ;
@@ -55,7 +54,9 @@ class MinesweeperRound {
5554 }
5655
5756 initGame ( ) {
58- this . calculateCellSizes ( ) ;
57+ if ( cellSize === 0 ) {
58+ this . calculateCellSizes ( ) ;
59+ }
5960
6061 this . grid = Array ( ) ;
6162 for ( let i = 0 ; i < this . width * this . height ; i ++ ) {
Original file line number Diff line number Diff line change @@ -307,6 +307,10 @@ <h2>Mines:</h2>
307307 if ( ! cell . revealed ) {
308308 game . flagCell ( mX , mY ) ;
309309 }
310+ } else if ( keyCode === 189 ) {
311+ game . calculateCellSizes ( cellSize - 5 ) ;
312+ } else if ( keyCode === 187 ) {
313+ game . calculateCellSizes ( cellSize + 5 ) ;
310314 }
311315 }
312316
You can’t perform that action at this time.
0 commit comments