Fix skipping zero length dash segments in dash_start.

The extra check makes sure zero length segments are not skipped when computing
the dash start state. This is needed so that we get proper line capping if, for
example, the first dash segment has zero length and we have a dash offset of
zero.
This commit is contained in:
Jeff Muizelaar 2006-04-09 23:11:27 -04:00 committed by Jeff Muizelaar
parent 5eaf71e77b
commit 2078557c5c

View file

@ -116,7 +116,11 @@ _cairo_stroker_start_dash (cairo_stroker_t *stroker)
int i = 0;
offset = stroker->style->dash_offset;
while (offset >= stroker->style->dash[i]) {
/* We stop searching for a starting point as soon as the
offset reaches zero. Otherwise when an initial dash
segment shrinks to zero it will be skipped over. */
while (offset > 0.0 && offset >= stroker->style->dash[i]) {
offset -= stroker->style->dash[i];
on = 1-on;
if (++i == stroker->style->num_dashes)