2018-02-12 16:01:20 +00:00
|
|
|
/**
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
|
|
* @copyright 2018 Photon Storm Ltd.
|
|
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
|
|
*/
|
|
|
|
|
2017-10-13 13:11:54 +00:00
|
|
|
/**
|
2018-10-01 10:35:01 +00:00
|
|
|
* Rounds a Rectangle's position and size down to the largest integer less than or equal to each current coordinate or dimension.
|
2017-10-13 13:11:54 +00:00
|
|
|
*
|
|
|
|
* @function Phaser.Geom.Rectangle.FloorAll
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
2018-03-27 13:27:08 +00:00
|
|
|
* @generic {Phaser.Geom.Rectangle} O - [rect,$return]
|
|
|
|
*
|
2018-10-01 10:35:01 +00:00
|
|
|
* @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust.
|
2017-10-13 13:11:54 +00:00
|
|
|
*
|
2018-10-01 10:35:01 +00:00
|
|
|
* @return {Phaser.Geom.Rectangle} The adjusted Rectangle.
|
2017-10-13 13:11:54 +00:00
|
|
|
*/
|
2016-12-20 17:07:16 +00:00
|
|
|
var FloorAll = function (rect)
|
|
|
|
{
|
|
|
|
rect.x = Math.floor(rect.x);
|
|
|
|
rect.y = Math.floor(rect.y);
|
|
|
|
rect.width = Math.floor(rect.width);
|
|
|
|
rect.height = Math.floor(rect.height);
|
|
|
|
|
|
|
|
return rect;
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = FloorAll;
|