1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

LibGfx: Add Point<T>::to_rounded<U>()

This commit is contained in:
Andreas Kling 2021-09-18 12:03:36 +02:00
parent 441e601689
commit f6a2d6af0b

View file

@ -13,6 +13,7 @@
#include <LibGfx/Forward.h>
#include <LibGfx/Orientation.h>
#include <LibIPC/Forward.h>
#include <math.h>
namespace Gfx {
@ -239,6 +240,12 @@ public:
return Point<U>(*this);
}
template<typename U>
[[nodiscard]] Point<U> to_rounded() const
{
return Point<U>(roundf(x()), roundf(y()));
}
[[nodiscard]] String to_string() const;
private: