mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:27:45 +00:00
LibGfx: Add Point::to_ceiled method for getting a ceiled Point
This commit is contained in:
parent
aa466723eb
commit
059a9c71a0
1 changed files with 7 additions and 1 deletions
|
@ -246,13 +246,19 @@ public:
|
||||||
return Point<U>(roundf(x()), roundf(y()));
|
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;
|
[[nodiscard]] String to_string() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T m_x { 0 };
|
T m_x { 0 };
|
||||||
T m_y { 0 };
|
T m_y { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
using IntPoint = Point<int>;
|
using IntPoint = Point<int>;
|
||||||
using FloatPoint = Point<float>;
|
using FloatPoint = Point<float>;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue