mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +00:00
LibWeb/CSS: Add Length::make_px(double) overload
Saves us a round-trip to CSSPixels and back when we already have a double value.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
38b037990b
commit
e65ca3a7d2
@@ -43,9 +43,14 @@ Length Length::make_auto()
|
||||
return Length(0, Type::Auto);
|
||||
}
|
||||
|
||||
Length Length::make_px(double value)
|
||||
{
|
||||
return Length(value, Type::Px);
|
||||
}
|
||||
|
||||
Length Length::make_px(CSSPixels value)
|
||||
{
|
||||
return Length(value.to_double(), Type::Px);
|
||||
return make_px(value.to_double());
|
||||
}
|
||||
|
||||
Length Length::percentage_of(Percentage const& percentage) const
|
||||
|
||||
Reference in New Issue
Block a user