فهرست منبع

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;
         VectorN<N, U> result;
         UNROLL_LOOP
         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;
         return result;
     }
     }