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
Notes: sideshowbarker 2024-07-17 11:06:27 +09:00

View file

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