From e4cca7886ed20991c8c718dc630597613a0a9fd1 Mon Sep 17 00:00:00 2001 From: MacDue Date: Sat, 18 Jun 2022 01:45:32 +0100 Subject: [PATCH] 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. --- Userland/Libraries/LibWeb/Painting/BorderPainting.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp b/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp index ea569a4dbff..e0c32506775 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(), p2.to_type(), color, int_width, gfx_line_style); + return; + } context.painter().draw_line(p1, p2, color, int_width, gfx_line_style); return; }