1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-28 21:22:08 +00:00

LibWeb: Add and use convinient from_raw helper in PixelUnits

This commit is contained in:
Hendiadyoin1 2023-07-26 14:58:51 +02:00 committed by Alexander Kalenik
parent 127b966219
commit 618f889486
2 changed files with 10 additions and 9 deletions

View file

@ -83,16 +83,12 @@ int CSSPixels::operator<=>(CSSPixels const& other) const
CSSPixels CSSPixels::operator+() const
{
CSSPixels result;
result.set_raw_value(+raw_value());
return result;
return from_raw(+raw_value());
}
CSSPixels CSSPixels::operator-() const
{
CSSPixels result;
result.set_raw_value(-raw_value());
return result;
return from_raw(-raw_value());
}
static inline int saturated_addition(int a, int b)
@ -156,9 +152,7 @@ CSSPixels& CSSPixels::operator/=(CSSPixels const& other)
CSSPixels CSSPixels::abs() const
{
CSSPixels result;
result.set_raw_value(::abs(m_value));
return result;
return from_raw(::abs(m_value));
}
}