Skip to content

Commit 9013107

Browse files
committed
The ScaleManager no longer creates a Phaser.FlexGrid if the class isn't available (i.e. excluded via a custom build)
1 parent d7d4320 commit 9013107

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/core/ScaleManager.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,10 @@ Phaser.ScaleManager.prototype = {
718718
// Don't use updateOrientationState so events are not fired
719719
this.screenOrientation = this.dom.getScreenOrientation(this.compatibility.orientationFallback);
720720

721-
this.grid = new Phaser.FlexGrid(this, this.width, this.height);
721+
if (Phaser.FlexGrid)
722+
{
723+
this.grid = new Phaser.FlexGrid(this, this.width, this.height);
724+
}
722725

723726
this._booted = true;
724727

@@ -958,7 +961,10 @@ Phaser.ScaleManager.prototype = {
958961
this._lastReportedCanvasSize.setTo(0, 0, width, height);
959962
this._lastReportedGameSize.setTo(0, 0, this.game.width, this.game.height);
960963

961-
this.grid.onResize(width, height);
964+
if (this.grid)
965+
{
966+
this.grid.onResize(width, height);
967+
}
962968

963969
this.onSizeChange.dispatch(this, width, height);
964970

@@ -1622,7 +1628,7 @@ Phaser.ScaleManager.prototype = {
16221628
*/
16231629
reset: function (clearWorld) {
16241630

1625-
if (clearWorld)
1631+
if (clearWorld && this.grid)
16261632
{
16271633
this.grid.reset();
16281634
}

0 commit comments

Comments
 (0)