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.
This commit is contained in:
Benjamin Otte
2023-07-27 09:48:34 +02:00
parent 538ca8e0d4
commit f2c20b7ca9

View File

@@ -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);