mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibWeb: Add Node::scaled_font(float scale_factor)
This will allow fetching fonts scaled by a transform.
This commit is contained in:
parent
f84abbe1f9
commit
21ace4f90b
Notes:
sideshowbarker
2024-07-17 02:55:44 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/21ace4f90b Pull-request: https://github.com/SerenityOS/serenity/pull/20115 Reviewed-by: https://github.com/AtkinsSJ
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user