phaser/src/geom/point/Floor.js

25 lines
635 B
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
2020-01-15 12:07:09 +00:00
* @copyright 2020 Photon Storm Ltd.
2019-05-10 15:15:04 +00:00
* @license {@link https://opensource.org/licenses/MIT|MIT License}
2018-02-12 16:01:20 +00:00
*/
2017-10-13 13:11:54 +00:00
/**
* Apply `Math.ceil()` to each coordinate of the given Point.
2017-10-13 13:11:54 +00:00
*
* @function Phaser.Geom.Point.Floor
* @since 3.0.0
*
2018-03-27 13:27:08 +00:00
* @generic {Phaser.Geom.Point} O - [point,$return]
*
* @param {Phaser.Geom.Point} point - The Point to floor.
2017-10-13 13:11:54 +00:00
*
* @return {Phaser.Geom.Point} The Point with `Math.floor()` applied to its coordinates.
2017-10-13 13:11:54 +00:00
*/
2017-01-03 22:21:47 +00:00
var Floor = function (point)
{
return point.setTo(Math.floor(point.x), Math.floor(point.y));
};
module.exports = Floor;