mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-17 23:00:33 +01:00
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:
parent
584109d5e6
commit
8a2ea660fb
1 changed files with 9 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue