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 #include -#include #include +#include #include #include #include @@ -100,6 +100,12 @@ public: } void constrain(const Rect&); + Point constrained(const Rect& rect) const + { + Point point = *this; + point.constrain(rect); + return point; + } bool operator==(const Point& other) const {