diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-02-21 15:56:34 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-02-27 09:47:35 +0000 |
commit | 127d7f43ea7043bba1d276d9721e80a702d9fd46 (patch) | |
tree | 9c8f111b67a97ea71159cfdd3649aad2f7016f16 /src/cairo-gstate.c | |
parent | 65a8a279430a08e6f28b1e0354e9f18fda1a0ad7 (diff) |
[cairo-path-bounds] _cairo_path_fixed_bounds() can fail...
I was wrong in my assertion that the call to
_cairo_path_fixed_interpret_flat() could not possibly fail with the
given _cairo_path_bounder_* callbacks - as I had missed the implicit
spline decomposition. (An interesting exercise would be to avoid the
spline allocation...) As a result we do have to check and propagate the
status return through the call stack.
Diffstat (limited to 'src/cairo-gstate.c')
-rw-r--r-- | src/cairo-gstate.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c index b6ddcb37..fef7d4fe 100644 --- a/src/cairo-gstate.c +++ b/src/cairo-gstate.c @@ -818,15 +818,21 @@ _cairo_gstate_stroke_to_path (cairo_gstate_t *gstate) } */ -void +cairo_status_t _cairo_gstate_path_extents (cairo_gstate_t *gstate, cairo_path_fixed_t *path, double *x1, double *y1, double *x2, double *y2) { - _cairo_path_fixed_bounds (path, x1, y1, x2, y2, gstate->tolerance); - + cairo_status_t status; + + status = _cairo_path_fixed_bounds (path, x1, y1, x2, y2, gstate->tolerance); + if (status) + return status; + _cairo_gstate_backend_to_user_rectangle (gstate, x1, y1, x2, y2, NULL); + + return CAIRO_STATUS_SUCCESS; } static cairo_status_t |