You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The property "right" seems to be wrong or I am misinterpreting the intent. Currently when value (the right coordinate) is input it sets width to be
this.width = this.x + value;
when I would expect width to be
this.width = value - this.x;
Original code below
/**
The sum of the x and width properties. Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property.
…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)
The property "right" seems to be wrong or I am misinterpreting the intent. Currently when value (the right coordinate) is input it sets width to be
this.width = this.x + value;
when I would expect width to be
this.width = value - this.x;
Original code below
/**
The sum of the x and width properties. Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property.
@name Phaser.Rectangle#right
@Property {number} right - The sum of the x and width properties.
*/
Object.defineProperty(Phaser.Rectangle.prototype, "right", {
get: function () {
return this.x + this.width;
},
set: function (value) {
if (value <= this.x) {
this.width = 0;
} else {
this.width = this.x + value;
}
}
});
The text was updated successfully, but these errors were encountered: