Rectangle.right when set would set the new width to be Rectangle.x + the value given. However the value given should be a new Right coordinate, so the width calculation has been adjusted to compensate (thanks @cryptonomicon, #849)

This commit is contained in:
photonstorm 2014-07-02 05:37:12 +01:00
parent 58fc73348c
commit 5ee9245acf
2 changed files with 2 additions and 1 deletions

View file

@ -146,6 +146,7 @@ Calling addToWorld() would previously not check the _toRemove array, which could
* Input.SinglePad was fixed so that the rawpad button array supports Windows and Linux (thank @renatodarrigo, fix #958)
* Key.duration wasn't set to zero after a Key.reset (thanks @DrHackenstein, #932)
* Device.mobileSafari was no longer detecting Mobile Safari, now fixed (thanks @Zammy, #927)
* Rectangle.right when set would set the new width to be Rectangle.x + the value given. However the value given should be a new Right coordinate, so the width calculation has been adjusted to compensate (thanks @cryptonomicon, #849)
### ToDo

View file

@ -395,7 +395,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "right", {
if (value <= this.x) {
this.width = 0;
} else {
this.width = this.x + value;
this.width = value - this.x;
}
}