mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 03:29:49 +00:00
LibGfx: Join ScaledFont into Font
Since ScaledFont is the only class inherited from Font we could simply merge them.
This commit is contained in:
parent
16e883a9a3
commit
8e2d1559ec
Notes:
github-actions[bot]
2025-04-21 07:52:41 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 8e2d1559ec
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4409
18 changed files with 166 additions and 234 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue