mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-01 15:18:06 +00:00
LibWeb+LibGfx: Paint miter_limit for SVG and Canvas
This commit is contained in:
parent
87ec5b32b0
commit
a64902ba25
Notes:
github-actions[bot]
2025-04-14 17:01:47 +00:00
Author: https://github.com/mehrankamal
Commit: a64902ba25
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4349
Reviewed-by: https://github.com/AtkinsSJ ✅
7 changed files with 10 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue