1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +00:00

LibWeb: Make resolution calculable

No tests unfortunately, because no CSS property we currently support
accepts `<resolution>`.
This commit is contained in:
Sam Atkins 2023-12-30 17:05:23 +00:00 committed by Andreas Kling
parent e907ad44c3
commit 30dcbc306c
7 changed files with 67 additions and 2 deletions

View file

@ -22,10 +22,14 @@ public:
static Optional<Type> unit_from_name(StringView);
Resolution(double value, Type type);
static Resolution make_dots_per_pixel(double);
String to_string() const;
double to_dots_per_pixel() const;
Type type() const { return m_type; }
double raw_value() const { return m_value; }
bool operator==(Resolution const& other) const
{
return m_type == other.m_type && m_value == other.m_value;