LibWeb: Add Node::scaled_font(float scale_factor)

This will allow fetching fonts scaled by a transform.
This commit is contained in:
MacDue 2023-07-20 20:24:22 +01:00 committed by Andreas Kling
parent f84abbe1f9
commit 21ace4f90b
Notes: sideshowbarker 2024-07-17 02:55:44 +09:00

View File

@ -123,6 +123,7 @@ public:
Gfx::Font const& font() const;
Gfx::Font const& scaled_font(PaintContext&) const;
Gfx::Font const& scaled_font(float scale_factor) const;
CSS::ImmutableComputedValues const& computed_values() const;
CSSPixels line_height() const;
@ -253,7 +254,12 @@ inline Gfx::Font const& Node::font() const
inline Gfx::Font const& Node::scaled_font(PaintContext& context) const
{
return *FontCache::the().scaled_font(font(), context.device_pixels_per_css_pixel());
return scaled_font(context.device_pixels_per_css_pixel());
}
inline Gfx::Font const& Node::scaled_font(float scale_factor) const
{
return *FontCache::the().scaled_font(font(), scale_factor);
}
inline const CSS::ImmutableComputedValues& Node::computed_values() const