mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 05:18:01 +02:00
Fix degenerate-pen test case by removing the triggering assertion
Instead we choose either the first or last pen vertex as appropriate. This makes the degenerate-pen pass stop failing on an assertion, and passes for most backends. It's still failing for the PDF backend, but that looks like a new, PDF-specific bug.
This commit is contained in:
parent
5e76f65284
commit
448c931425
1 changed files with 15 additions and 1 deletions
|
|
@ -323,7 +323,13 @@ _cairo_pen_find_active_cw_vertex_index (cairo_pen_t *pen,
|
|||
break;
|
||||
}
|
||||
|
||||
assert (i < pen->num_vertices);
|
||||
/* If the desired slope cannot be found between any of the pen
|
||||
* vertices, then we must have a degenerate pen, (such as a pen
|
||||
* that's been transformed to a line). In that case, we consider
|
||||
* the first pen vertex as the appropriate clockwise vertex.
|
||||
*/
|
||||
if (i == pen->num_vertices)
|
||||
i = 0;
|
||||
|
||||
*active = i;
|
||||
}
|
||||
|
|
@ -351,6 +357,14 @@ _cairo_pen_find_active_ccw_vertex_index (cairo_pen_t *pen,
|
|||
break;
|
||||
}
|
||||
|
||||
/* If the desired slope cannot be found between any of the pen
|
||||
* vertices, then we must have a degenerate pen, (such as a pen
|
||||
* that's been transformed to a line). In that case, we consider
|
||||
* the last pen vertex as the appropriate counterclockwise vertex.
|
||||
*/
|
||||
if (i < 0)
|
||||
i = pen->num_vertices - 1;
|
||||
|
||||
*active = i;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue