summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-09-17 12:03:24 +0430
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-09-18 02:12:38 +0430
commit5a2e7d30ce2f673cd84073c1e96287329fe310db (patch)
tree897b0f223a76a5a0fe462b8eed152e8ab527e470 /Userland/Libraries/LibWeb/Layout
parente2cd5581018601c0efd248e764dfd8546be70d60 (diff)
downloadserenity-5a2e7d30ce2f673cd84073c1e96287329fe310db.zip
LibWeb: Use Gfx::AntiAliasingPainter to draw SVG paths
This is still quite bad, but it's much more pleasing to look at when drawing random SVGs :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout')
-rw-r--r--Userland/Libraries/LibWeb/Layout/SVGPathBox.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/SVGPathBox.cpp b/Userland/Libraries/LibWeb/Layout/SVGPathBox.cpp
index a7377c069c..b93a05c90d 100644
--- a/Userland/Libraries/LibWeb/Layout/SVGPathBox.cpp
+++ b/Userland/Libraries/LibWeb/Layout/SVGPathBox.cpp
@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
+#include <LibGfx/AntiAliasingPainter.h>
#include <LibGfx/Painter.h>
#include <LibWeb/Layout/SVGPathBox.h>
#include <LibWeb/SVG/SVGPathElement.h>
@@ -47,10 +48,10 @@ void SVGPathBox::paint(PaintContext& context, PaintPhase phase)
closed_path.close();
// Fills are computed as though all paths are closed (https://svgwg.org/svg2-draft/painting.html#FillProperties)
- auto& painter = context.painter();
+ Gfx::AntiAliasingPainter painter { context.painter() };
auto& svg_context = context.svg_context();
- auto offset = (absolute_position() - effective_offset()).to_type<int>();
+ auto offset = absolute_position() - effective_offset();
painter.translate(offset);