Merge pull request #2353 from fillmoreb/patch-1

Fix for world.centerX and world.centerY with negative bounds origin.
This commit is contained in:
Richard Davey 2016-02-26 15:20:05 +02:00
commit a8ae5a0024

View file

@ -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;
}
});