1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:57:35 +00:00

LibGfx: Use AK::round_to for VectorN::to_rounded<U>

This commit is contained in:
Jelle Raaijmakers 2022-05-08 22:13:23 +02:00 committed by Linus Groh
parent 878111abf6
commit 54a24fe45a

View file

@ -239,12 +239,8 @@ public:
{ {
VectorN<N, U> result; VectorN<N, U> result;
UNROLL_LOOP UNROLL_LOOP
for (auto i = 0u; i < N; ++i) { for (auto i = 0u; i < N; ++i)
if constexpr (IsSame<T, float>) result.data()[i] = round_to<U>(m_data[i]);
result.data()[i] = static_cast<U>(lrintf(m_data[i]));
else
result.data()[i] = static_cast<U>(lrint(m_data[i]));
}
return result; return result;
} }