Skip to content

Commit a9ddf46

Browse files
committed
Update BaseCamera.js
* `BaseCamera.config` has been removed as it's no longer required. * `BaseCamera.scaleManager` is a new property that references the Scale Manager and is used internally for size checks.
1 parent d7e7fee commit a9ddf46

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

src/cameras/2d/BaseCamera.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,13 @@ var BaseCamera = new Class({
119119
this.sceneManager;
120120

121121
/**
122-
* A reference to the Game Config.
122+
* A reference to the Game Scale Manager.
123123
*
124-
* @name Phaser.Cameras.Scene2D.BaseCamera#config
125-
* @type {object}
126-
* @readonly
127-
* @since 3.12.0
124+
* @name Phaser.Cameras.Scene2D.BaseCamera#scaleManager
125+
* @type {Phaser.DOM.ScaleManager}
126+
* @since 3.16.0
128127
*/
129-
this.config;
128+
this.scaleManager;
130129

131130
/**
132131
* The Camera ID. Assigned by the Camera Manager and used to handle camera exclusion.
@@ -1276,10 +1275,10 @@ var BaseCamera = new Class({
12761275

12771276
this.scene = scene;
12781277

1279-
this.config = scene.sys.game.config;
12801278
this.sceneManager = scene.sys.game.scene;
1279+
this.scaleManager = scene.sys.scale;
12811280

1282-
var res = this.config.resolution;
1281+
var res = this.scaleManager.resolution;
12831282

12841283
this.resolution = res;
12851284

@@ -1479,12 +1478,12 @@ var BaseCamera = new Class({
14791478
*/
14801479
updateSystem: function ()
14811480
{
1482-
if (!this.config)
1481+
if (!this.scaleManager)
14831482
{
14841483
return;
14851484
}
14861485

1487-
var custom = (this._x !== 0 || this._y !== 0 || this.config.width !== this._width || this.config.height !== this._height);
1486+
var custom = (this._x !== 0 || this._y !== 0 || this.scaleManager.width !== this._width || this.scaleManager.height !== this._height);
14881487

14891488
var sceneManager = this.sceneManager;
14901489

@@ -1542,7 +1541,7 @@ var BaseCamera = new Class({
15421541
this._bounds = null;
15431542

15441543
this.scene = null;
1545-
this.config = null;
1544+
this.scaleManager = null;
15461545
this.sceneManager = null;
15471546
},
15481547

0 commit comments

Comments
 (0)