1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:58:11 +00:00

LibWeb: Scale the font when painting the text on buttons

Button text was staying the same size at all zoom levels. :^)
This commit is contained in:
Andreas Kling 2023-03-15 22:53:38 +01:00
parent 20132da88d
commit 5146b9b35e
4 changed files with 29 additions and 18 deletions

View file

@ -37,6 +37,8 @@ public:
RefPtr<Gfx::Font const> get(FontSelector const&) const;
void set(FontSelector const&, NonnullRefPtr<Gfx::Font const>);
NonnullRefPtr<Gfx::Font const> scaled_font(Gfx::Font const&, float scale_factor);
private:
FontCache() = default;
mutable HashMap<FontSelector, NonnullRefPtr<Gfx::Font const>> m_fonts;