From 65e706ee14b9bfbc2ce0e83b35a813d51d97592f Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Sun, 9 Apr 2006 23:13:36 -0400 Subject: [PATCH] Reset dashing for new subpaths. Fixes the bug mentioned in b87726ee2aa0220b66ee4d97513c0ac89ffc4621 by reseting the dash pattern for each new subpath. This is correct behaviour according to the end of PDF Reference v1.6 section 4.3.2. This commit now makes the dash-caps-joins test case pass for all backends except for the PostScript backend. --- src/cairo-path-stroke.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c index 96664ceeb..a02a3aaa4 100644 --- a/src/cairo-path-stroke.c +++ b/src/cairo-path-stroke.c @@ -615,6 +615,16 @@ _cairo_stroker_move_to (void *closure, cairo_point_t *point) return CAIRO_STATUS_SUCCESS; } +static cairo_status_t +_cairo_stroker_move_to_dashed (void *closure, cairo_point_t *point) +{ + /* reset the dash pattern for new sub paths */ + cairo_stroker_t *stroker = closure; + _cairo_stroker_start_dash (stroker); + + return _cairo_stroker_move_to (closure, point); +} + static cairo_status_t _cairo_stroker_line_to (void *closure, cairo_point_t *point) { @@ -954,7 +964,7 @@ _cairo_path_fixed_stroke_to_traps (cairo_path_fixed_t *path, if (stroker.style->dash) status = _cairo_path_fixed_interpret (path, CAIRO_DIRECTION_FORWARD, - _cairo_stroker_move_to, + _cairo_stroker_move_to_dashed, _cairo_stroker_line_to_dashed, _cairo_stroker_curve_to_dashed, _cairo_stroker_close_path,