mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-03-07 04:00:31 +01:00
Add _cairo_round()
_cairo_round() has the same behaviour as _cairo_lround() except it returns a double instead of an integer.
This commit is contained in:
parent
41e46c7754
commit
dffdbd8515
1 changed files with 9 additions and 0 deletions
|
|
@ -1024,6 +1024,15 @@ typedef struct _cairo_stroke_face {
|
|||
cairo_private void
|
||||
_cairo_restrict_value (double *value, double min, double max);
|
||||
|
||||
/* C99 round() rounds to the nearest integral value with halfway cases rounded
|
||||
* away from 0. _cairo_round rounds halfway cases toward negative infinity.
|
||||
* This matches the rounding behaviour of _cairo_lround. */
|
||||
static inline double
|
||||
_cairo_round (double r)
|
||||
{
|
||||
return floor (r + .5);
|
||||
}
|
||||
|
||||
cairo_private int
|
||||
_cairo_lround (double d);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue