diff --git a/Userland/Libraries/LibGfx/Rect.h b/Userland/Libraries/LibGfx/Rect.h index 502fc0d6795..ab9370ffce4 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 {