Skip to content

Commit eff10ce

Browse files
committed
Moved the width / height floor into the ScaleManager (phaserjs#2329)
1 parent fc3ffe5 commit eff10ce

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

src/core/Game.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -530,13 +530,6 @@ Phaser.Game.prototype = {
530530
return;
531531
}
532532

533-
// The game width / height must be an integer
534-
this.width = Math.floor(this.width);
535-
this.height = Math.floor(this.height);
536-
537-
this._width = Math.floor(this._width);
538-
this._height = Math.floor(this._height);
539-
540533
this.onPause = new Phaser.Signal();
541534
this.onResume = new Phaser.Signal();
542535
this.onBlur = new Phaser.Signal();

src/core/ScaleManager.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,9 @@ Phaser.ScaleManager.prototype = {
845845
newHeight = rect.height * this.parentScaleFactor.y;
846846
}
847847

848+
newWidth = Math.floor(newWidth);
849+
newHeight = Math.floor(newHeight);
850+
848851
this._gameSize.setTo(0, 0, newWidth, newHeight);
849852

850853
this.updateDimensions(newWidth, newHeight, false);

0 commit comments

Comments
 (0)