summaryrefslogtreecommitdiff
path: root/src/cairo-path-bounds.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2008-01-21 13:47:05 -0800
committerCarl Worth <cworth@cworth.org>2008-01-21 13:47:05 -0800
commit63df3a82a3a4a035edf89152995a324449616059 (patch)
treec43719c9a08583fb897d986f739de8bee8202f36 /src/cairo-path-bounds.c
parentc15cab8b6855540436e457465c4766812c6def55 (diff)
downloadcairo-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.c11
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;