mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 23:20:59 +00:00
Merge pull request #2353 from fillmoreb/patch-1
Fix for world.centerX and world.centerY with negative bounds origin.
This commit is contained in:
commit
a8ae5a0024
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