mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
LibWeb: Make resolution calculable
No tests unfortunately, because no CSS property we currently support accepts `<resolution>`.
This commit is contained in:
parent
e907ad44c3
commit
30dcbc306c
7 changed files with 67 additions and 2 deletions
|
@ -14,6 +14,11 @@ Resolution::Resolution(double value, Type type)
|
|||
{
|
||||
}
|
||||
|
||||
Resolution Resolution::make_dots_per_pixel(double value)
|
||||
{
|
||||
return { value, Type::Dppx };
|
||||
}
|
||||
|
||||
String Resolution::to_string() const
|
||||
{
|
||||
return MUST(String::formatted("{}dppx", to_dots_per_pixel()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue