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

LibGfx: Load default font lazily

This is required when trying to use a Painter from lagom, due to
/res/font not being present
This commit is contained in:
Hendiadyoin1 2021-11-28 16:09:38 +01:00 committed by Ali Mohammad Pur
parent e69276e704
commit 9e7c16d0a4
2 changed files with 8 additions and 2 deletions

View file

@ -64,7 +64,7 @@ Painter::Painter(Gfx::Bitmap& bitmap)
VERIFY(bitmap.physical_width() % scale == 0);
VERIFY(bitmap.physical_height() % scale == 0);
m_state_stack.append(State());
state().font = &FontDatabase::default_font();
state().font = nullptr;
state().clip_rect = { { 0, 0 }, bitmap.size() };
state().scale = scale;
m_clip_origin = state().clip_rect;