1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 21:35:06 +00:00

LibHTML: Always fill the entire paint event rect with background

And do the filling before translating the painter.

This fixes a bug where scrolling down in the Help app would render the
bottom part of the page with a different background color.
This commit is contained in:
Andreas Kling 2019-10-05 21:51:28 +02:00
parent 4173c77eb5
commit 56d1ae98bc

View file

@ -85,11 +85,11 @@ void HtmlView::paint_event(GPaintEvent& event)
return;
}
painter.fill_rect(event.rect(), m_document->background_color());
painter.translate(frame_thickness(), frame_thickness());
painter.translate(-horizontal_scrollbar().value(), -vertical_scrollbar().value());
painter.fill_rect(rect(), m_document->background_color());
RenderingContext context { painter };
m_layout_root->render(context);
}