Merge branch 'develop' of github.com:thecodingmachine/workadventure into gameSizeFix

This commit is contained in:
GRL 2021-06-15 09:06:47 +02:00
commit b04016f30f
5 changed files with 63 additions and 25 deletions

View file

@ -46,10 +46,11 @@ class WaScaleManager {
gameStyle.width = style.width;
gameStyle.height = style.height;
// Note: onResize will be called twice (once here and once is Game.ts), but we have no better way.
// Note: onResize will be called twice (once here and once in Game.ts), but we have no better way.
for (const scene of this.game.scene.getScenes(true)) {
if (scene instanceof ResizableScene) {
scene.onResize();
// We are delaying the call to the "render" event because otherwise, the "camera" coordinates are not correctly updated.
scene.events.once(Phaser.Scenes.Events.RENDER, () => scene.onResize());
}
}