From 4ec01669fcaca7cb0a9036378381814363534a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Offenh=C3=A4user?= Date: Fri, 24 Mar 2023 21:57:01 +0100 Subject: [PATCH] LibPDF: Scale vector paths with the view This ensures that lines have the correct size at every scale factor. --- Userland/Libraries/LibPDF/Renderer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibPDF/Renderer.cpp b/Userland/Libraries/LibPDF/Renderer.cpp index f4dfc20ed9..7d59aa61b7 100644 --- a/Userland/Libraries/LibPDF/Renderer.cpp +++ b/Userland/Libraries/LibPDF/Renderer.cpp @@ -299,7 +299,7 @@ void Renderer::end_path_paint() RENDERER_HANDLER(path_stroke) { begin_path_paint(); - m_anti_aliasing_painter.stroke_path(m_current_path, state().stroke_color, state().line_width); + m_anti_aliasing_painter.stroke_path(m_current_path, state().stroke_color, state().ctm.x_scale() * state().line_width); end_path_paint(); return {}; } @@ -334,13 +334,13 @@ RENDERER_HANDLER(path_fill_evenodd) RENDERER_HANDLER(path_fill_stroke_nonzero) { - m_anti_aliasing_painter.stroke_path(m_current_path, state().stroke_color, state().line_width); + m_anti_aliasing_painter.stroke_path(m_current_path, state().stroke_color, state().ctm.x_scale() * state().line_width); return handle_path_fill_nonzero(args); } RENDERER_HANDLER(path_fill_stroke_evenodd) { - m_anti_aliasing_painter.stroke_path(m_current_path, state().stroke_color, state().line_width); + m_anti_aliasing_painter.stroke_path(m_current_path, state().stroke_color, state().ctm.x_scale() * state().line_width); return handle_path_fill_evenodd(args); }