LibGfx: Join ScaledFont into Font

Since ScaledFont is the only class inherited from Font we could simply
merge them.
This commit is contained in:
Aliaksandr Kalenik 2025-04-19 19:10:01 +02:00 committed by Andreas Kling
commit 8e2d1559ec
Notes: github-actions[bot] 2025-04-21 07:52:41 +00:00
18 changed files with 166 additions and 234 deletions

View file

@ -150,8 +150,8 @@ public:
bool can_contain_boxes_with_position_absolute() const;
Gfx::Font const& first_available_font() const;
Gfx::Font const& scaled_font(PaintContext&) const;
Gfx::Font const& scaled_font(float scale_factor) const;
Gfx::Font const& font(PaintContext&) const;
Gfx::Font const& font(float scale_factor) const;
CSS::ImmutableComputedValues const& computed_values() const;
@ -315,12 +315,12 @@ inline Gfx::Font const& Node::first_available_font() const
return parent()->first_available_font();
}
inline Gfx::Font const& Node::scaled_font(PaintContext& context) const
inline Gfx::Font const& Node::font(PaintContext& context) const
{
return scaled_font(context.device_pixels_per_css_pixel());
return font(context.device_pixels_per_css_pixel());
}
inline Gfx::Font const& Node::scaled_font(float scale_factor) const
inline Gfx::Font const& Node::font(float scale_factor) const
{
auto const& font = first_available_font();
return font.with_size(font.point_size() * scale_factor);