[stroke] Cap trailing segment when skipping invisible segments.

If we do not maintain the current_face even for invisible dashed segments,
then we will generate spurious line segments when attempting to close the
path (ala leaky-dashed-rectangle).

This fixes the long standing regression introduced just prior to 1.6 and
captured in these bug reports:
http://lists.cairographics.org/archives/cairo/2008-April/013912.html
http://bugs.freedesktop.org/show_bug.cgi?id=17177
This commit is contained in:
Chris Wilson 2008-09-24 18:12:22 +01:00
parent 9fc745ae9f
commit 444d44acde

View file

@ -915,6 +915,14 @@ _cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point)
stroker->has_current_face = FALSE;
}
}
} else {
if (stroker->has_current_face) {
/* Cap final face from previous segment */
status = _cairo_stroker_add_trailing_cap (stroker, &stroker->current_face);
if (status)
return status;
stroker->has_current_face = FALSE;
}
}
_cairo_stroker_step_dash (stroker, step_length);