summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2010-10-16 22:51:28 +0200
committerChris Wilson <chris@chris-wilson.co.uk>2010-11-26 10:01:19 +0000
commit2b3d8de11a536d668084ea6d2bf295da1d1cdc11 (patch)
treea2725a1902d4e246d545ac8899c27b83012a56a2
parentfafca7ace250e3f4f9c60584f0ddff187c690068 (diff)
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.
-rw-r--r--src/cairo-arc.c4
-rw-r--r--src/cairo.c1
2 files changed, 5 insertions, 0 deletions
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;
}