LibGfx: Make it possible to stroke a path with a paint style

This commit is contained in:
Luke Wilde 2023-06-06 20:38:48 +01:00 committed by Andreas Kling
parent 1367809142
commit 8993a710f8
Notes: sideshowbarker 2024-07-17 02:59:43 +09:00
2 changed files with 7 additions and 0 deletions

View file

@ -198,6 +198,12 @@ void AntiAliasingPainter::stroke_path(Path const& path, Color color, float thick
fill_path(path.stroke_to_fill(thickness), color); fill_path(path.stroke_to_fill(thickness), color);
} }
void AntiAliasingPainter::stroke_path(Path const& path, Gfx::PaintStyle const& paint_style, float thickness)
{
// FIXME: Cache this? Probably at a higher level such as in LibWeb?
fill_path(path.stroke_to_fill(thickness), paint_style);
}
void AntiAliasingPainter::fill_rect(FloatRect const& float_rect, Color color) void AntiAliasingPainter::fill_rect(FloatRect const& float_rect, Color color)
{ {
// Draw the integer part of the rectangle: // Draw the integer part of the rectangle:

View file

@ -37,6 +37,7 @@ public:
void fill_path(Path const&, PaintStyle const& paint_style, Painter::WindingRule rule = Painter::WindingRule::Nonzero); void fill_path(Path const&, PaintStyle const& paint_style, Painter::WindingRule rule = Painter::WindingRule::Nonzero);
void stroke_path(Path const&, Color, float thickness); void stroke_path(Path const&, Color, float thickness);
void stroke_path(Path const&, PaintStyle const& paint_style, float thickness);
void translate(float dx, float dy) { m_transform.translate(dx, dy); } void translate(float dx, float dy) { m_transform.translate(dx, dy); }
void translate(FloatPoint delta) { m_transform.translate(delta); } void translate(FloatPoint delta) { m_transform.translate(delta); }