@@ -310,16 +310,25 @@ Phaser.StageScaleMode.prototype = {
310310
311311 if ( this . isFullScreen )
312312 {
313- this . game . stage . canvas . style [ 'width' ] = '100%' ;
314- this . game . stage . canvas . style [ 'height' ] = '100%' ;
313+ if ( this . game . stage . fullScreenScaleMode === Phaser . StageScaleMode . EXACT_FIT )
314+ {
315+ this . game . stage . canvas . style [ 'width' ] = '100%' ;
316+ this . game . stage . canvas . style [ 'height' ] = '100%' ;
315317
316- this . setMaximum ( ) ;
318+ this . setMaximum ( ) ;
317319
318- this . game . input . scale . setTo ( this . game . width / this . width , this . game . height / this . height ) ;
320+ this . game . input . scale . setTo ( this . game . width / this . width , this . game . height / this . height ) ;
321+
322+ this . aspectRatio = this . width / this . height ;
323+ this . scaleFactor . x = this . game . width / this . width ;
324+ this . scaleFactor . y = this . game . height / this . height ;
325+ }
326+ else if ( this . game . stage . fullScreenScaleMode === Phaser . StageScaleMode . SHOW_ALL )
327+ {
328+ this . game . stage . scale . setShowAll ( ) ;
329+ this . game . stage . scale . refresh ( ) ;
330+ }
319331
320- this . aspectRatio = this . width / this . height ;
321- this . scaleFactor . x = this . game . width / this . width ;
322- this . scaleFactor . y = this . game . height / this . height ;
323332 }
324333 else
325334 {
@@ -560,13 +569,27 @@ Phaser.StageScaleMode.prototype = {
560569 {
561570 this . setMaximum ( ) ;
562571 }
563- else if ( this . game . stage . scaleMode == Phaser . StageScaleMode . EXACT_FIT )
572+ else if ( ! this . isFullScreen )
564573 {
565- this . setExactFit ( ) ;
574+ if ( this . game . stage . scaleMode == Phaser . StageScaleMode . EXACT_FIT )
575+ {
576+ this . setExactFit ( ) ;
577+ }
578+ else if ( this . game . stage . scaleMode == Phaser . StageScaleMode . SHOW_ALL )
579+ {
580+ this . setShowAll ( ) ;
581+ }
566582 }
567- else if ( this . game . stage . scaleMode == Phaser . StageScaleMode . SHOW_ALL )
583+ else
568584 {
569- this . setShowAll ( ) ;
585+ if ( this . game . stage . fullScreenScaleMode == Phaser . StageScaleMode . EXACT_FIT )
586+ {
587+ this . setExactFit ( ) ;
588+ }
589+ else if ( this . game . stage . fullScreenScaleMode == Phaser . StageScaleMode . SHOW_ALL )
590+ {
591+ this . setShowAll ( ) ;
592+ }
570593 }
571594
572595 this . setSize ( ) ;
0 commit comments