LibWeb+LibGfx: Paint miter_limit for SVG and Canvas

This commit is contained in:
Mehran Kamal 2025-04-14 14:24:19 +05:00 committed by Sam Atkins
commit a64902ba25
Notes: github-actions[bot] 2025-04-14 17:01:47 +00:00
7 changed files with 10 additions and 7 deletions

View file

@ -225,7 +225,7 @@ void PainterSkia::stroke_path(Gfx::Path const& path, Gfx::PaintStyle const& pain
});
}
void PainterSkia::stroke_path(Gfx::Path const& path, Gfx::PaintStyle const& paint_style, ReadonlySpan<Gfx::Filter> filters, float thickness, float global_alpha, Gfx::CompositingAndBlendingOperator compositing_and_blending_operator, Gfx::Path::CapStyle const& cap_style, Gfx::Path::JoinStyle const& join_style)
void PainterSkia::stroke_path(Gfx::Path const& path, Gfx::PaintStyle const& paint_style, ReadonlySpan<Gfx::Filter> filters, float thickness, float global_alpha, Gfx::CompositingAndBlendingOperator compositing_and_blending_operator, Gfx::Path::CapStyle const& cap_style, Gfx::Path::JoinStyle const& join_style, float miter_limit)
{
// Skia treats zero thickness as a special case and will draw a hairline, while we want to draw nothing.
if (thickness <= 0)
@ -240,6 +240,7 @@ void PainterSkia::stroke_path(Gfx::Path const& path, Gfx::PaintStyle const& pain
paint.setStrokeWidth(thickness);
paint.setStrokeCap(to_skia_cap(cap_style));
paint.setStrokeJoin(to_skia_join(join_style));
paint.setStrokeMiter(miter_limit);
paint.setBlender(to_skia_blender(compositing_and_blending_operator));
impl().with_canvas([&](auto& canvas) {
canvas.drawPath(sk_path, paint);