summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibGfx/Point.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGfx/Point.cpp b/Userland/Libraries/LibGfx/Point.cpp
index 1b35b50203..88d542bc38 100644
--- a/Userland/Libraries/LibGfx/Point.cpp
+++ b/Userland/Libraries/LibGfx/Point.cpp
@@ -15,8 +15,8 @@ namespace Gfx {
template<typename T>
void Point<T>::constrain(Rect<T> const& rect)
{
- m_x = AK::clamp<T>(x(), rect.left(), rect.right());
- m_y = AK::clamp<T>(y(), rect.top(), rect.bottom());
+ m_x = AK::clamp<T>(x(), rect.left(), rect.left() + rect.width());
+ m_y = AK::clamp<T>(y(), rect.top(), rect.top() + rect.height());
}
template<typename T>