From f2c20b7ca9e3702ca6febb1d4ae936c3fec8c903 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 27 Jul 2023 09:48:34 +0200 Subject: [PATCH] contour: Compute stroke bounds correctly We need to set the minimum miterwidth to sqrt(2) * line_width to catch the square joins/butts of diagonal lines, because the rectangle spanned by the square is rotated by 90 degrees. --- gsk/gskcontour.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsk/gskcontour.c b/gsk/gskcontour.c index 829b6a5ec9..814d4e2e99 100644 --- a/gsk/gskcontour.c +++ b/gsk/gskcontour.c @@ -1634,7 +1634,7 @@ gsk_standard_contour_get_stroke_bounds (const GskContour *contour, data.bounds = bounds; data.lw = stroke->line_width; - data.mw = MAX (stroke->miter_limit, 1.f) * stroke->line_width; + data.mw = MAX (stroke->miter_limit, G_SQRT2) * stroke->line_width; graphene_rect_init (bounds, self->points[0].x - data.mw/2, self->points[0].y - data.mw/2, data.mw, data.mw);