From cf50eded175beb85c472747ae5c62333677685ed Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 13 Dec 2020 22:42:09 -0500 Subject: [PATCH] contour: Special-case circles for strokes The outline of a circle is just two circles. --- gsk/gskcontour.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gsk/gskcontour.c b/gsk/gskcontour.c index 0f20a3dc51..b6c363286a 100644 --- a/gsk/gskcontour.c +++ b/gsk/gskcontour.c @@ -999,6 +999,23 @@ gsk_circle_contour_add_stroke (const GskContour *contour, GskPathBuilder *builder, GskStroke *stroke) { + const GskCircleContour *self = (const GskCircleContour *) contour; + + if (stroke->dash_length == 0 && + fabs (self->start_angle - self->end_angle) >= 360) + { + GskContour *c; + + c = gsk_circle_contour_new (&self->center, self->radius + stroke->line_width / 2, + self->start_angle, + self->end_angle); + gsk_path_builder_add_contour (builder, c); + + c = gsk_circle_contour_new (&self->center, self->radius - stroke->line_width / 2, + self->end_angle, + self->start_angle); + gsk_path_builder_add_contour (builder, c); + } } static void