Check for zero length dashed lines.

This makes line_to_dashed more like line_to by returning immediately on
degenerate paths. This is needed so that we can do the slope calculation for
the entire line.
This commit is contained in:
Jeff Muizelaar 2006-04-09 23:10:46 -04:00 committed by Jeff Muizelaar
parent 584109d5e6
commit 8a2ea660fb

View file

@ -686,7 +686,15 @@ _cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point)
if (!stroker->has_current_point)
return _cairo_stroker_move_to (stroker, point);
if (p1->x == p2->x && p1->y == p2->y) {
/* XXX: Need to rethink how this case should be handled, (both
here and in cairo_stroker_add_sub_edge and in _compute_face). The
key behavior is that degenerate paths should draw as much
as possible. */
return CAIRO_STATUS_SUCCESS;
}
dx = _cairo_fixed_to_double (p2->x - p1->x);
dy = _cairo_fixed_to_double (p2->y - p1->y);