diff options
Diffstat (limited to 'Libraries/LibGfx/Point.h')
-rw-r--r-- | Libraries/LibGfx/Point.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Libraries/LibGfx/Point.h b/Libraries/LibGfx/Point.h index 9603625ef8..6357b9d2b7 100644 --- a/Libraries/LibGfx/Point.h +++ b/Libraries/LibGfx/Point.h @@ -28,8 +28,8 @@ #include <AK/Forward.h> #include <AK/StdLibExtras.h> -#include <LibGfx/Orientation.h> #include <LibGfx/Forward.h> +#include <LibGfx/Orientation.h> #include <LibIPC/Forward.h> #include <math.h> #include <stdlib.h> @@ -100,6 +100,12 @@ public: } void constrain(const Rect<T>&); + Point<T> constrained(const Rect<T>& rect) const + { + Point<T> point = *this; + point.constrain(rect); + return point; + } bool operator==(const Point<T>& other) const { |