forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCeilAll.js
More file actions
29 lines (26 loc) · 804 Bytes
/
Copy pathCeilAll.js
File metadata and controls
29 lines (26 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2019 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Rounds a Rectangle's position and size up to the smallest integer greater than or equal to each respective value.
*
* @function Phaser.Geom.Rectangle.CeilAll
* @since 3.0.0
*
* @generic {Phaser.Geom.Rectangle} O - [rect,$return]
*
* @param {Phaser.Geom.Rectangle} rect - The Rectangle to modify.
*
* @return {Phaser.Geom.Rectangle} The modified Rectangle.
*/
var CeilAll = function (rect)
{
rect.x = Math.ceil(rect.x);
rect.y = Math.ceil(rect.y);
rect.width = Math.ceil(rect.width);
rect.height = Math.ceil(rect.height);
return rect;
};
module.exports = CeilAll;