diff options
author | Carl Worth <cworth@cworth.org> | 2008-01-21 13:47:05 -0800 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2008-01-21 13:47:05 -0800 |
commit | 63df3a82a3a4a035edf89152995a324449616059 (patch) | |
tree | c43719c9a08583fb897d986f739de8bee8202f36 /src/cairo-path-bounds.c | |
parent | c15cab8b6855540436e457465c4766812c6def55 (diff) | |
download | cairo-63df3a82a3a4a035edf89152995a324449616059.tar.gz |
Fix cairo_path_extents to ignore lone cairo_move_to points.
Update the documentation as well.
Diffstat (limited to 'src/cairo-path-bounds.c')
-rw-r--r-- | src/cairo-path-bounds.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/cairo-path-bounds.c b/src/cairo-path-bounds.c index f996977be..b945c4050 100644 --- a/src/cairo-path-bounds.c +++ b/src/cairo-path-bounds.c @@ -37,6 +37,8 @@ #include "cairoint.h" typedef struct cairo_path_bounder { + cairo_point_t trailing_move_to_point; + int has_trailing_move_to; int has_point; cairo_fixed_t min_x; @@ -105,7 +107,8 @@ _cairo_path_bounder_move_to (void *closure, cairo_point_t *point) { cairo_path_bounder_t *bounder = closure; - _cairo_path_bounder_add_point (bounder, point); + bounder->trailing_move_to_point = *point; + bounder->has_trailing_move_to = 1; return CAIRO_STATUS_SUCCESS; } @@ -115,6 +118,12 @@ _cairo_path_bounder_line_to (void *closure, cairo_point_t *point) { cairo_path_bounder_t *bounder = closure; + if (bounder->has_trailing_move_to) { + _cairo_path_bounder_add_point (bounder, + &bounder->trailing_move_to_point); + bounder->has_trailing_move_to = 0; + } + _cairo_path_bounder_add_point (bounder, point); return CAIRO_STATUS_SUCCESS; |