Skip to content

Commit

Permalink
Rectangle.right when set would set the new width to be Rectangle.x + …
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
photonstorm committed Jul 2, 2014
1 parent 58fc733 commit 5ee9245
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/geom/Rectangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 5ee9245

Please sign in to comment.