瀏覽代碼

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

Jelle Raaijmakers 3 年之前
父節點
當前提交
54a24fe45a
共有 1 個文件被更改,包括 2 次插入6 次删除
  1. 2 6
      Userland/Libraries/LibGfx/VectorN.h

+ 2 - 6
Userland/Libraries/LibGfx/VectorN.h

@@ -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;
     }