Skip to content

Commit

Permalink
Fix degenerate arcs
Browse files Browse the repository at this point in the history
Make sure that degenerate arcs become a move_to-line_to sequence
instead of just a move_to.

Fixes get-path-extents.
  • Loading branch information
Andrea Canciani authored and Chris Wilson committed Nov 26, 2010
1 parent fafca7a commit 2b3d8de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cairo-arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
1 change: 1 addition & 0 deletions src/cairo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1852,6 +1852,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;
}
Expand Down

0 comments on commit 2b3d8de

Please sign in to comment.