diff --git a/Userland/Libraries/LibGfx/Rect.h b/Userland/Libraries/LibGfx/Rect.h index e52319f42e..57b7d249c6 100644 --- a/Userland/Libraries/LibGfx/Rect.h +++ b/Userland/Libraries/LibGfx/Rect.h @@ -700,12 +700,21 @@ public: template [[nodiscard]] ALWAYS_INLINE Rect to_rounded() const { - return { - static_cast(llroundd(x())), - static_cast(llroundd(y())), - static_cast(llroundd(width())), - static_cast(llroundd(height())), - }; + if constexpr (IsSame) { + return { + static_cast(llroundf(x())), + static_cast(llroundf(y())), + static_cast(llroundf(width())), + static_cast(llroundf(height())), + }; + } else { + return { + static_cast(llroundd(x())), + static_cast(llroundd(y())), + static_cast(llroundd(width())), + static_cast(llroundd(height())), + }; + } } [[nodiscard]] String to_string() const;