mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:47:35 +00:00
LibGfx: Add Point<T>::to_rounded<U>()
This commit is contained in:
parent
441e601689
commit
f6a2d6af0b
1 changed files with 7 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
||||||
#include <LibGfx/Forward.h>
|
#include <LibGfx/Forward.h>
|
||||||
#include <LibGfx/Orientation.h>
|
#include <LibGfx/Orientation.h>
|
||||||
#include <LibIPC/Forward.h>
|
#include <LibIPC/Forward.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
namespace Gfx {
|
namespace Gfx {
|
||||||
|
|
||||||
|
@ -239,6 +240,12 @@ public:
|
||||||
return Point<U>(*this);
|
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;
|
[[nodiscard]] String to_string() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue