diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-07-29 15:36:25 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-07-29 16:17:12 +0100 |
commit | 71f5649846aa8e9e2178e7caf69ab47554f86c4d (patch) | |
tree | f7ce4ebf849318bef5df27103224858a4dcb205c | |
parent | acfcf4a31b3370ca7bbdd522fad9ddc483df3472 (diff) |
[path] Fix iter to handle circular list of buffers
When switching the path over to use the circularly linked list, 73f801,
I missed updating the path iterator.
-rw-r--r-- | src/cairo-path-fixed-private.h | 1 | ||||
-rw-r--r-- | src/cairo-path-fixed.c | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/cairo-path-fixed-private.h b/src/cairo-path-fixed-private.h index 1ef7cdda..f25a45e2 100644 --- a/src/cairo-path-fixed-private.h +++ b/src/cairo-path-fixed-private.h @@ -112,6 +112,7 @@ _cairo_path_fixed_equal (const cairo_path_fixed_t *a, const cairo_path_fixed_t *b); typedef struct _cairo_path_fixed_iter { + const cairo_path_buf_t *first; const cairo_path_buf_t *buf; unsigned int n_op; unsigned int n_point; diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c index 8b5d5c59..921c79e9 100644 --- a/src/cairo-path-fixed.c +++ b/src/cairo-path-fixed.c @@ -1143,7 +1143,7 @@ void _cairo_path_fixed_iter_init (cairo_path_fixed_iter_t *iter, const cairo_path_fixed_t *path) { - iter->buf = cairo_path_head (path); + iter->first = iter->buf = cairo_path_head (path); iter->n_op = 0; iter->n_point = 0; } @@ -1153,11 +1153,16 @@ _cairo_path_fixed_iter_next_op (cairo_path_fixed_iter_t *iter) { if (++iter->n_op >= iter->buf->num_ops) { iter->buf = cairo_path_buf_next (iter->buf); + if (iter->buf == iter->first) { + iter->buf = NULL; + return FALSE; + } + iter->n_op = 0; iter->n_point = 0; } - return iter->buf != NULL; + return TRUE; } cairo_bool_t |