mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibGfx: Add Point<T>::to_rounded<U>()
This commit is contained in:
parent
441e601689
commit
f6a2d6af0b
Notes:
sideshowbarker
2024-07-18 03:44:11 +09:00
Author: https://github.com/awesomekling
Commit: f6a2d6af0b
1 changed files with 7 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue