mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:17:35 +00:00
LibGfx: Add Size<T>::to_rounded<I>()
Currently this is only specialized for rounding to integer types.
This commit is contained in:
parent
77f0a66d2f
commit
264543b90a
1 changed files with 6 additions and 0 deletions
|
@ -164,6 +164,12 @@ public:
|
|||
|
||||
[[nodiscard]] String to_string() const;
|
||||
|
||||
template<Integral I>
|
||||
[[nodiscard]] Size<I> to_rounded() const
|
||||
{
|
||||
return Size<I>(round_to<I>(width()), round_to<I>(height()));
|
||||
}
|
||||
|
||||
private:
|
||||
T m_width { 0 };
|
||||
T m_height { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue