Skip to content

Commit 5ee9245

Browse files
committed
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, phaserjs#849)
1 parent 58fc733 commit 5ee9245

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ Calling addToWorld() would previously not check the _toRemove array, which could
146146
* Input.SinglePad was fixed so that the rawpad button array supports Windows and Linux (thank @renatodarrigo, fix #958)
147147
* Key.duration wasn't set to zero after a Key.reset (thanks @DrHackenstein, #932)
148148
* Device.mobileSafari was no longer detecting Mobile Safari, now fixed (thanks @Zammy, #927)
149+
* 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)
149150

150151

151152
### ToDo

src/geom/Rectangle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "right", {
395395
if (value <= this.x) {
396396
this.width = 0;
397397
} else {
398-
this.width = this.x + value;
398+
this.width = value - this.x;
399399
}
400400
}
401401

0 commit comments

Comments
 (0)