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

LibWeb: Always update layout (if needed) before painting

This commit is contained in:
Andreas Kling 2021-10-28 18:14:38 +02:00
parent 7ec7729e1b
commit 23561133aa

View file

@ -64,6 +64,10 @@ void PageHost::paint(const Gfx::IntRect& content_rect, Gfx::Bitmap& target)
Gfx::Painter painter(target);
Gfx::IntRect bitmap_rect { {}, content_rect.size() };
auto* document = page().top_level_browsing_context().active_document();
VERIFY(document);
document->update_layout();
auto* layout_root = this->layout_root();
if (!layout_root) {
painter.fill_rect(bitmap_rect, Color::White);