1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

LibWeb: Use doubles for CSS dimension types

Avoid unintentionally converting between float and double multiple times
by just using double everywhere. Also, remove the unused `int` versions
of their constructors.
This commit is contained in:
Sam Atkins 2023-08-20 13:02:41 +01:00 committed by Sam Atkins
parent 95f80bc65b
commit 1feacd4b52
16 changed files with 34 additions and 73 deletions

View file

@ -21,11 +21,10 @@ public:
static Optional<Type> unit_from_name(StringView);
Resolution(int value, Type type);
Resolution(float value, Type type);
Resolution(double value, Type type);
ErrorOr<String> to_string() const;
float to_dots_per_pixel() const;
double to_dots_per_pixel() const;
bool operator==(Resolution const& other) const
{
@ -48,6 +47,6 @@ private:
StringView unit_name() const;
Type m_type;
float m_value { 0 };
double m_value { 0 };
};
}