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:
Andrea Canciani 2010-10-16 22:51:28 +02:00
parent a1d8763236
commit 0655198301
2 changed files with 5 additions and 0 deletions

View file

@ -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));
}
}

View file

@ -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;
}