From 78aad28dbab77be8e38a087e38a5b7c992206998 Mon Sep 17 00:00:00 2001 From: MacDue Date: Fri, 7 Apr 2023 13:25:15 +0100 Subject: [PATCH] LibGfx: Add Point::to_floored() --- Userland/Libraries/LibGfx/Point.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Userland/Libraries/LibGfx/Point.h b/Userland/Libraries/LibGfx/Point.h index 67c3ce89b8..606a4162c9 100644 --- a/Userland/Libraries/LibGfx/Point.h +++ b/Userland/Libraries/LibGfx/Point.h @@ -247,6 +247,13 @@ public: return Point(ceil(x()), ceil(y())); } + template + requires FloatingPoint + [[nodiscard]] Point to_floored() const + { + return Point(AK::floor(x()), AK::floor(y())); + } + [[nodiscard]] DeprecatedString to_deprecated_string() const; private: