1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-23 10:07:40 +00:00

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

This commit is contained in:
Andreas Kling 2022-09-25 19:09:08 +02:00
parent 58a44036a9
commit 6b2ce2ccc3
2 changed files with 6 additions and 0 deletions

View file

@ -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) };

View file

@ -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();