1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:37:35 +00:00

LibPDF: Scale vector paths with the view

This ensures that lines have the correct size at every scale factor.
This commit is contained in:
Julian Offenhäuser 2023-03-24 21:57:01 +01:00 committed by Andrew Kaster
parent 731676c041
commit 4ec01669fc

View file

@ -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);
}