Reset dashing for new subpaths.

Fixes the bug mentioned in b87726ee2a 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.
This commit is contained in:
Jeff Muizelaar 2006-04-09 23:13:36 -04:00 committed by Carl Worth
parent f02aacbb5f
commit 65e706ee14

View file

@ -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,