From a1a4d6966e1d9c8ccf84c9972a4f9560553948f6 Mon Sep 17 00:00:00 2001 From: Jeff Smith Date: Mon, 19 Feb 2007 16:06:56 -0500 Subject: [PATCH] Modify how _cairo_stroker_add_caps handles zero-length sub-paths For zero-length sub-paths, _cairo_stroker_add_caps sets up a dummy face, then lets later parts of the function add the caps. --- src/cairo-path-stroke.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c index 55eee68ea..4827ab0bf 100644 --- a/src/cairo-path-stroke.c +++ b/src/cairo-path-stroke.c @@ -473,10 +473,15 @@ _cairo_stroker_add_caps (cairo_stroker_t *stroker) { /* pick an arbitrary slope to use */ cairo_slope_t slope = {1, 0}; - _compute_face (&stroker->first_point, &slope, stroker, &stroker->first_face); + cairo_stroke_face_t face; + _compute_face (&stroker->first_point, &slope, stroker, &face); - stroker->has_first_face = stroker->has_current_face = TRUE; - stroker->current_face = stroker->first_face; + status = _cairo_stroker_add_leading_cap (stroker, &face); + if (status) + return status; + status = _cairo_stroker_add_trailing_cap (stroker, &face); + if (status) + return status; } if (stroker->has_first_face) {