LibGfx/AntialiasingPainter: Allow passing through a cap style

This commit is contained in:
Nico Weber 2024-09-24 20:44:25 -04:00
parent 67bf00c6b0
commit 7f528a4fa6
2 changed files with 3 additions and 3 deletions

View file

@ -200,12 +200,12 @@ void AntiAliasingPainter::stroke_path(Path const& path, Color color, float thick
fill_path(path.stroke_to_fill(thickness), color);
}
void AntiAliasingPainter::stroke_path(Path const& path, Gfx::PaintStyle const& paint_style, float thickness, float opacity)
void AntiAliasingPainter::stroke_path(Path const& path, Gfx::PaintStyle const& paint_style, float thickness, float opacity, Path::CapStyle cap_style)
{
if (thickness <= 0)
return;
// FIXME: Cache this? Probably at a higher level such as in LibWeb?
fill_path(path.stroke_to_fill(thickness), paint_style, opacity);
fill_path(path.stroke_to_fill(thickness, cap_style), paint_style, opacity);
}
void AntiAliasingPainter::fill_rect(FloatRect const& float_rect, Color color)

View file

@ -38,7 +38,7 @@ public:
void fill_path(Path const&, PaintStyle const& paint_style, float opacity = 1.0f, Painter::WindingRule rule = Painter::WindingRule::Nonzero);
void stroke_path(Path const&, Color, float thickness);
void stroke_path(Path const&, PaintStyle const& paint_style, float thickness, float opacity = 1.0f);
void stroke_path(Path const&, PaintStyle const& paint_style, float thickness, float opacity = 1.0f, Path::CapStyle cap_style = Path::CapStyle::Round);
void translate(float dx, float dy) { m_transform.translate(dx, dy); }
void translate(FloatPoint delta) { m_transform.translate(delta); }