mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Update World.js
Phaser.World.centerX and Phaser.World.centerY only worked if the bounds had an origin of 0,0. This change takes into account the actual origin.
This commit is contained in:
parent
ba5981a03f
commit
b1c74e694e
1 changed files with 2 additions and 2 deletions
|
@ -299,7 +299,7 @@ Object.defineProperty(Phaser.World.prototype, "height", {
|
|||
Object.defineProperty(Phaser.World.prototype, "centerX", {
|
||||
|
||||
get: function () {
|
||||
return this.bounds.halfWidth;
|
||||
return this.bounds.halfWidth + this.bounds.x;
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -312,7 +312,7 @@ Object.defineProperty(Phaser.World.prototype, "centerX", {
|
|||
Object.defineProperty(Phaser.World.prototype, "centerY", {
|
||||
|
||||
get: function () {
|
||||
return this.bounds.halfHeight;
|
||||
return this.bounds.halfHeight + this.bounds.y;
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue