From df9951334d4189c0ea99a003af4ae999b82652d1 Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Wed, 9 Dec 2009 19:39:45 +0100 Subject: [PATCH] Remove final MOVE_TO when interpreting paths _cairo_path_fixed_close_path appends a MOVE_TO right after CLOSE_PATH. This can leave an extra MOVE_TO at the end of a path, which is neither needed nor wanted. This can be solved by making _cairo_path_fixed_interpret ignore a trailing MOVE_TO. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=25238 --- src/cairo-path-fixed.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c index 42172c6..694e95a 100644 --- a/src/cairo-path-fixed.c +++ b/src/cairo-path-fixed.c @@ -750,11 +750,12 @@ _cairo_path_fixed_interpret (const cairo_path_fixed_t *path, 0, /* cairo_path_op_close_path */ }; cairo_status_t status; - const cairo_path_buf_t *buf, *first; + const cairo_path_buf_t *buf, *first, *last; cairo_bool_t forward = (dir == CAIRO_DIRECTION_FORWARD); int step = forward ? 1 : -1; buf = first = forward ? cairo_path_head (path) : cairo_path_tail (path); + last = forward ? cairo_path_tail (path) : cairo_path_head (path); do { cairo_point_t *points; int start, stop, i; @@ -769,6 +770,9 @@ _cairo_path_fixed_interpret (const cairo_path_fixed_t *path, points = buf->points + buf->num_points; } + if (buf == last && buf->num_ops != 0 && buf->op[stop - step] == CAIRO_PATH_OP_MOVE_TO) + stop -= step; + for (i = start; i != stop; i += step) { cairo_path_op_t op = buf->op[i]; -- 1.6.4.4