diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-11-25 12:05:26 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-11-25 12:54:58 +0000 |
commit | 06fabd6cbd0ad187f5f9f155d6b7962f76ec5dda (patch) | |
tree | b4bd58dd1b96d00ab8408da6fb1496830b72658c /src/cairo-path-bounds.c | |
parent | 1f44fb97f3973aa90c4f27bcf9341149370c825d (diff) | |
download | cairo-06fabd6cbd0ad187f5f9f155d6b7962f76ec5dda.tar.gz |
[path] Fix up extents.
Forgot to round the box to the integer rectangle and missed why only
testing on image. Very naughty.
Diffstat (limited to 'src/cairo-path-bounds.c')
-rw-r--r-- | src/cairo-path-bounds.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/cairo-path-bounds.c b/src/cairo-path-bounds.c index 54df5bff4..6245cd26a 100644 --- a/src/cairo-path-bounds.c +++ b/src/cairo-path-bounds.c @@ -172,18 +172,20 @@ _cairo_path_fixed_approximate_extents (cairo_path_fixed_t *path, _cairo_path_bounder_init (&bounder); status = _cairo_path_fixed_interpret (path, CAIRO_DIRECTION_FORWARD, - _cairo_path_bounder_move_to, - _cairo_path_bounder_line_to, - _cairo_path_bounder_curve_to, - _cairo_path_bounder_close_path, - &bounder); + _cairo_path_bounder_move_to, + _cairo_path_bounder_line_to, + _cairo_path_bounder_curve_to, + _cairo_path_bounder_close_path, + &bounder); assert (status == CAIRO_STATUS_SUCCESS); if (bounder.has_point) { - extents->x = bounder.min_x; - extents->y = bounder.min_y; - extents->width = bounder.max_x - extents->x; - extents->height = bounder.max_y - extents->y; + extents->x = _cairo_fixed_integer_floor (bounder.min_x); + extents->y = _cairo_fixed_integer_floor (bounder.min_y); + extents->width = + _cairo_fixed_integer_ceil (bounder.max_x) - extents->x; + extents->height = + _cairo_fixed_integer_ceil (bounder.max_y) - extents->y; } else { extents->x = extents->y = 0; extents->width = extents->height = 0; |