diff options
author | stelar7 <dudedbz@gmail.com> | 2023-05-27 21:10:21 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-31 10:56:32 +0200 |
commit | 421559d725bdab745620df3b0fc2f0a4244b0332 (patch) | |
tree | 1e5f8c22f81ea410d15f9c20db6714f5ad00740d /Userland/Libraries/LibWeb/CSS/Angle.cpp | |
parent | f5da6d61b43e38b02c22b35f074966c1a36cd797 (diff) | |
download | serenity-421559d725bdab745620df3b0fc2f0a4244b0332.zip |
LibWeb: Change calc node representation from float to double
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/Angle.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Angle.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Angle.cpp b/Userland/Libraries/LibWeb/CSS/Angle.cpp index 2b0ae58622..37acc9ad65 100644 --- a/Userland/Libraries/LibWeb/CSS/Angle.cpp +++ b/Userland/Libraries/LibWeb/CSS/Angle.cpp @@ -16,13 +16,13 @@ Angle::Angle(int value, Type type) { } -Angle::Angle(float value, Type type) +Angle::Angle(double value, Type type) : m_type(type) , m_value(value) { } -Angle Angle::make_degrees(float value) +Angle Angle::make_degrees(double value) { return { value, Type::Deg }; } @@ -37,17 +37,17 @@ ErrorOr<String> Angle::to_string() const return String::formatted("{}deg", to_degrees()); } -float Angle::to_degrees() const +double Angle::to_degrees() const { switch (m_type) { case Type::Deg: return m_value; case Type::Grad: - return m_value * (360.0f / 400.0f); + return m_value * (360.0 / 400.0); case Type::Rad: - return m_value * (180.0f / AK::Pi<float>); + return m_value * (180.0 / AK::Pi<double>); case Type::Turn: - return m_value * 360.0f; + return m_value * 360.0; } VERIFY_NOT_REACHED(); } |