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
Notes: sideshowbarker 2024-07-19 11:48:43 +09:00

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