فهرست منبع

LibWeb: Add CSS::Size::make_px(float) convenience helper

Andreas Kling 2 سال پیش
والد
کامیت
6b2ce2ccc3
2فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 5 0
      Userland/Libraries/LibWeb/CSS/Size.cpp
  2. 1 0
      Userland/Libraries/LibWeb/CSS/Size.h

+ 5 - 0
Userland/Libraries/LibWeb/CSS/Size.cpp

@@ -26,6 +26,11 @@ Size Size::make_auto()
     return Size { Type::Auto, Length::make_auto() };
 }
 
+Size Size::make_px(float px)
+{
+    return make_length(CSS::Length::make_px(px));
+}
+
 Size Size::make_length(Length length)
 {
     return Size { Type::Length, move(length) };

+ 1 - 0
Userland/Libraries/LibWeb/CSS/Size.h

@@ -24,6 +24,7 @@ public:
     };
 
     static Size make_auto();
+    static Size make_px(float);
     static Size make_length(Length);
     static Size make_percentage(Percentage);
     static Size make_min_content();