File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -47,19 +47,19 @@ var Board = (function() {
4747 var bufferCanvas = document . createElement ( 'canvas' ) ;
4848 var bufferCtx = bufferCanvas . getContext ( '2d' ) ;
4949
50- bufferCanvas . width = widthCanvas ;
51- bufferCanvas . height = heightCanvas ;
50+ bufferCanvas . width = this . domMem . width ;
51+ bufferCanvas . height = this . domMem . height ;
5252
5353 // Clear buffer
5454 bufferCtx . fillStyle = '#ffffff' ;
5555 bufferCtx . fillRect ( 0 , 0 , widthCanvas , heightCanvas ) ;
5656
5757 // Save canvas to buffer
5858 bufferCtx . drawImage ( this . dom , 0 , 0 ) ;
59-
59+
6060 // Resize memory
61- this . domMem . width = widthCanvas ;
62- this . domMem . height = heightCanvas ;
61+ if ( this . domMem . width < widthCanvas ) this . domMem . width = widthCanvas ;
62+ if ( this . domMem . height < heightCanvas ) this . domMem . height = heightCanvas ;
6363 this . ctxMem . drawImage ( bufferCanvas , 0 , 0 ) ;
6464 } else {
6565 this . ctxMem . drawImage ( this . dom , 0 , 0 ) ;
You can’t perform that action at this time.
0 commit comments