CPoint:Floor
The Floor method rounds both the x,y properties to the next lower integer value. For example P.x=100.54 becomes P.x=100. Compare with the Round and Ceil methods.
CPoint:Floor() |
One common use of this method is when converting fractional fractional image pixel coordinates to the integral coordinates of the pixel. The value of the image pixel is effective at its center, which occurs at an exact integer coordinate.
The following script lists the values of a point before and after using the Floor method.
|
-- Create a CPoint |
|
-- result: 50.322, 100.55 |
|
-- round to the next lower integer values |
|
-- result: 50, 100 |