diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-25 19:09:08 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-29 18:33:41 +0200 |
commit | 6b2ce2ccc3158d76f7ec2c0ac4164de01c2cda6f (patch) | |
tree | 8c041b15fd4061be1c14aa72a132aeb7394eaccf /Userland/Libraries/LibWeb/CSS/Size.cpp | |
parent | 58a44036a9ffd5880d89cf631f93c2649e48a173 (diff) | |
download | serenity-6b2ce2ccc3158d76f7ec2c0ac4164de01c2cda6f.zip |
LibWeb: Add CSS::Size::make_px(float) convenience helper
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/Size.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Size.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Size.cpp b/Userland/Libraries/LibWeb/CSS/Size.cpp index bdc4ebd5f3..fc83076d23 100644 --- a/Userland/Libraries/LibWeb/CSS/Size.cpp +++ b/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) }; |