mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-07 07:28:02 +02:00
Fix degenerate arcs
Make sure that degenerate arcs become a move_to-line_to sequence instead of just a move_to. Fixes get-path-extents.
This commit is contained in:
parent
a1d8763236
commit
0655198301
2 changed files with 5 additions and 0 deletions
|
|
@ -231,6 +231,10 @@ _cairo_arc_in_direction (cairo_t *cr,
|
|||
angle,
|
||||
angle + angle_step);
|
||||
}
|
||||
} else {
|
||||
cairo_line_to (cr,
|
||||
xc + radius * cos (angle_min),
|
||||
yc + radius * sin (angle_min));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1856,6 +1856,7 @@ cairo_arc (cairo_t *cr,
|
|||
|
||||
/* Do nothing, successfully, if radius is <= 0 */
|
||||
if (radius <= 0.0) {
|
||||
cairo_line_to (cr, xc, yc); /* might become a move_to */
|
||||
cairo_line_to (cr, xc, yc);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue