mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibGfx: Use AK::round_to
for VectorN::to_rounded<U>
This commit is contained in:
parent
878111abf6
commit
54a24fe45a
Notes:
sideshowbarker
2024-07-17 11:06:27 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/54a24fe45a Pull-request: https://github.com/SerenityOS/serenity/pull/13970 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/sunverwerth ✅
1 changed files with 2 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue