mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 13:17:36 +00:00
LibWeb: Add CSS::Size::make_px(float) convenience helper
This commit is contained in:
parent
58a44036a9
commit
6b2ce2ccc3
2 changed files with 6 additions and 0 deletions
|
@ -26,6 +26,11 @@ Size Size::make_auto()
|
||||||
return Size { Type::Auto, Length::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)
|
Size Size::make_length(Length length)
|
||||||
{
|
{
|
||||||
return Size { Type::Length, move(length) };
|
return Size { Type::Length, move(length) };
|
||||||
|
|
|
@ -24,6 +24,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
static Size make_auto();
|
static Size make_auto();
|
||||||
|
static Size make_px(float);
|
||||||
static Size make_length(Length);
|
static Size make_length(Length);
|
||||||
static Size make_percentage(Percentage);
|
static Size make_percentage(Percentage);
|
||||||
static Size make_min_content();
|
static Size make_min_content();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue