From 2b3d8de11a536d668084ea6d2bf295da1d1cdc11 Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Sat, 16 Oct 2010 22:51:28 +0200 Subject: [PATCH] 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. --- src/cairo-arc.c | 4 ++++ src/cairo.c | 1 + 2 files changed, 5 insertions(+) diff --git a/src/cairo-arc.c b/src/cairo-arc.c index 56d42f19e..1b2713f39 100644 --- a/src/cairo-arc.c +++ b/src/cairo-arc.c @@ -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)); } } diff --git a/src/cairo.c b/src/cairo.c index 157f898f4..5117f8a97 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -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; }