Explorar o código

LibWeb: Add Node::scaled_font(float scale_factor)

This will allow fetching fonts scaled by a transform.
MacDue %!s(int64=2) %!d(string=hai) anos
pai
achega
21ace4f90b
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      Userland/Libraries/LibWeb/Layout/Node.h

+ 7 - 1
Userland/Libraries/LibWeb/Layout/Node.h

@@ -123,6 +123,7 @@ public:
 
 
     Gfx::Font const& font() const;
     Gfx::Font const& font() const;
     Gfx::Font const& scaled_font(PaintContext&) const;
     Gfx::Font const& scaled_font(PaintContext&) const;
+    Gfx::Font const& scaled_font(float scale_factor) const;
 
 
     CSS::ImmutableComputedValues const& computed_values() const;
     CSS::ImmutableComputedValues const& computed_values() const;
     CSSPixels line_height() 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
 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
 inline const CSS::ImmutableComputedValues& Node::computed_values() const