diff options
author | MacDue <macdue@dueutil.tech> | 2022-06-18 01:45:32 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-06-18 02:34:56 +0100 |
commit | e4cca7886ed20991c8c718dc630597613a0a9fd1 (patch) | |
tree | ad79703e2af4729ab3d3e84cd3fb7f1a363b25cb /Userland | |
parent | 6139fc5c87ff4a5bbdcbfdb0c105a781270acdbc (diff) | |
download | serenity-e4cca7886ed20991c8c718dc630597613a0a9fd1.zip |
LibWeb: Use the AA painter for drawing dotted lines
The AA painter will actually draw the dots as circles, which is
how other browsers handle this.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/BorderPainting.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp b/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp index ea569a4dbf..e0c3250677 100644 --- a/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp +++ b/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp @@ -133,6 +133,11 @@ void paint_border(PaintContext& context, BorderEdge edge, Gfx::IntRect const& re p2.translate_by(int_width / 2, -int_width / 2); break; } + if (border_style == CSS::LineStyle::Dotted) { + Gfx::AntiAliasingPainter aa_painter { context.painter() }; + aa_painter.draw_line(p1.to_type<float>(), p2.to_type<float>(), color, int_width, gfx_line_style); + return; + } context.painter().draw_line(p1, p2, color, int_width, gfx_line_style); return; } |