1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

LibPDF: Ensure all subpaths are closed before filling paths

This lets us correctly draw figure 3.4 in pdf_reference_1-7.pdf.
This commit is contained in:
MacDue 2023-07-24 19:02:36 +01:00 committed by Andreas Kling
parent ccf35a973f
commit 6088374ad2

View file

@ -298,6 +298,7 @@ RENDERER_HANDLER(path_close_and_stroke)
RENDERER_HANDLER(path_fill_nonzero)
{
begin_path_paint();
m_current_path.close_all_subpaths();
m_anti_aliasing_painter.fill_path(m_current_path, state().paint_color, Gfx::Painter::WindingRule::Nonzero);
end_path_paint();
return {};
@ -311,6 +312,7 @@ RENDERER_HANDLER(path_fill_nonzero_deprecated)
RENDERER_HANDLER(path_fill_evenodd)
{
begin_path_paint();
m_current_path.close_all_subpaths();
m_anti_aliasing_painter.fill_path(m_current_path, state().paint_color, Gfx::Painter::WindingRule::EvenOdd);
end_path_paint();
return {};