Rectangle.bottomLeft has been added (thanks @mattmogford #1788)

This commit is contained in:
photonstorm 2015-05-12 13:00:40 +01:00
parent c823037a4f
commit 7b938f396e
2 changed files with 28 additions and 3 deletions

View file

@ -295,6 +295,7 @@ Version 2.4 - "Katar" - in dev
* Input.Touch.addTouchLockCallback allows you to add a callback that will be invoked automatically upon a touchstart event. This is used internally by the SoundManager and Video objects to handle mobile device unlocking, but is exposed publicly as well.
* Frame.resize allows you to change the dimensions of a Frame object and recalculate all of its internal properties (such as `bottom` and `distance`).
* LoadTexture.resizeFrame lets you resize the Frame dimensions that the Game Object uses for rendering. You shouldn't normally need to ever call this, but in the case of special texture types such as Video or BitmapData it can be useful to adjust the dimensions directly in this way.
* Rectangle.bottomLeft has been added (thanks @mattmogford #1788)
### Updates
@ -331,6 +332,7 @@ Version 2.4 - "Katar" - in dev
* BitmapData.update now validates the `width` and `height` values to ensure they aren't lower than 1, which would previously cause a context error.
* Texture.requiresReTint is a new property that controls if a texture requires the display object to be re-tinted having been updated internally. The LoadTexture component now sets this.
* PIXI.Sprite.tintedTexture contains a canvas object that holds the tinted version of the Sprite. This is only populated in Canvas, not in WebGL.
* ScaleManager.scaleSprite will no longer try and scale a display object that doesn't have a scale property.
### Bug Fixes

View file

@ -397,18 +397,41 @@ Object.defineProperty(Phaser.Rectangle.prototype, "bottom", {
},
set: function (value) {
if (value <= this.y) {
if (value <= this.y)
{
this.height = 0;
} else {
}
else
{
this.height = value - this.y;
}
}
});
/**
* The location of the Rectangles bottom left corner as a Point object.
* @name Phaser.Rectangle#bottomLeft
* @property {Phaser.Point} bottomLeft - Gets or sets the location of the Rectangles bottom left corner as a Point object.
*/
Object.defineProperty(Phaser.Rectangle.prototype, "bottomLeft", {
get: function () {
return new Phaser.Point(this.x, this.bottom);
},
set: function (value) {
this.x = value.x;
this.bottom = value.y;
}
});
/**
* The location of the Rectangles bottom right corner as a Point object.
* @name Phaser.Rectangle#bottom
* @name Phaser.Rectangle#bottomRight
* @property {Phaser.Point} bottomRight - Gets or sets the location of the Rectangles bottom right corner as a Point object.
*/
Object.defineProperty(Phaser.Rectangle.prototype, "bottomRight", {