ScaleManager.refresh is now called when the Game.READY event fires. This fixes a bug where the Scale Manager would have the incorrect canvas bounds, because they were calculated before a previous canvas was removed from the DOM. Fix #4905

This commit is contained in:
Richard Davey 2020-09-11 12:10:10 +01:00
parent e8a8dd53e7
commit ce236f0d69

View file

@ -421,7 +421,7 @@ var ScaleManager = new Class({
// Parse the config to get the scaling values we need
this.parseConfig(this.game.config);
this.game.events.once('boot', this.boot, this);
this.game.events.once(GameEvents.BOOT, this.boot, this);
},
/**
@ -464,6 +464,7 @@ var ScaleManager = new Class({
}
game.events.on(GameEvents.PRE_STEP, this.step, this);
game.events.once(GameEvents.READY, this.refresh, this);
game.events.once(GameEvents.DESTROY, this.destroy, this);
this.startListeners();