1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 09:17:35 +00:00

LibGfx: Add Point::to_ceiled method for getting a ceiled Point

This commit is contained in:
Crax97 2022-08-29 22:47:33 +02:00 committed by Andreas Kling
parent aa466723eb
commit 059a9c71a0

View file

@ -246,13 +246,19 @@ public:
return Point<U>(roundf(x()), roundf(y()));
}
template<typename U>
requires FloatingPoint<T>
[[nodiscard]] Point<U> to_ceiled() const
{
return Point<U>(ceil(x()), ceil(y()));
}
[[nodiscard]] String to_string() const;
private:
T m_x { 0 };
T m_y { 0 };
};
using IntPoint = Point<int>;
using FloatPoint = Point<float>;