From 7f528a4fa655bce52fb6e570dd4d063b24ad5c6f Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 24 Sep 2024 20:44:25 -0400 Subject: [PATCH] LibGfx/AntialiasingPainter: Allow passing through a cap style --- Userland/Libraries/LibGfx/AntiAliasingPainter.cpp | 4 ++-- Userland/Libraries/LibGfx/AntiAliasingPainter.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp b/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp index b7ae961078..7b5b90dcca 100644 --- a/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp +++ b/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp @@ -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) diff --git a/Userland/Libraries/LibGfx/AntiAliasingPainter.h b/Userland/Libraries/LibGfx/AntiAliasingPainter.h index 11d197a1ea..f4b20f7d05 100644 --- a/Userland/Libraries/LibGfx/AntiAliasingPainter.h +++ b/Userland/Libraries/LibGfx/AntiAliasingPainter.h @@ -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); }