diff --git a/Userland/Libraries/LibGfx/Rect.h b/Userland/Libraries/LibGfx/Rect.h index 502fc0d67958bb4308c3127269a69b7e1302093f..ab9370ffce4dab84e0cf5a48465a93f5d2e9a800 100644 --- a/Userland/Libraries/LibGfx/Rect.h +++ b/Userland/Libraries/LibGfx/Rect.h @@ -715,6 +715,11 @@ using FloatRect = Rect; return Gfx::IntRect::from_two_points({ x1, y1 }, { x2, y2 }); } +[[nodiscard]] ALWAYS_INLINE IntRect rounded_int_rect(FloatRect const& float_rect) +{ + return IntRect { floorf(float_rect.x()), floorf(float_rect.y()), roundf(float_rect.width()), roundf(float_rect.height()) }; +} + } namespace AK {