Game no longer pauses if you've forced orientation and change it, also doesn't resize a NO_SCALE game.

If the game was set to NO_SCALE and you swapped orientation, it would pause and resize, then fail to resize when you swapped back (thanks starnut, fixes #258)
This commit is contained in:
photonstorm
2014-02-28 04:15:28 +00:00
parent 09d4a35b7f
commit e3d53ad6a3
3 changed files with 69 additions and 4 deletions
+8 -4
View File
@@ -409,7 +409,6 @@ Phaser.ScaleManager.prototype = {
if ((this.forceLandscape && window.innerWidth > window.innerHeight) || (this.forcePortrait && window.innerHeight > window.innerWidth))
{
// Back to normal
this.game.paused = false;
this.incorrectOrientation = false;
this.leaveIncorrectOrientation.dispatch();
@@ -419,7 +418,10 @@ Phaser.ScaleManager.prototype = {
this.game.world.visible = true;
}
this.refresh();
if (this.scaleMode !== Phaser.ScaleManager.NO_SCALE)
{
this.refresh();
}
}
}
else
@@ -427,7 +429,6 @@ Phaser.ScaleManager.prototype = {
if ((this.forceLandscape && window.innerWidth < window.innerHeight) || (this.forcePortrait && window.innerHeight < window.innerWidth))
{
// Show orientation screen
this.game.paused = true;
this.incorrectOrientation = true;
this.enterIncorrectOrientation.dispatch();
@@ -437,7 +438,10 @@ Phaser.ScaleManager.prototype = {
this.game.world.visible = false;
}
this.refresh();
if (this.scaleMode !== Phaser.ScaleManager.NO_SCALE)
{
this.refresh();
}
}
}
},