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 void Point::constrain(Rect const& rect) { - m_x = AK::clamp(x(), rect.left(), rect.right()); - m_y = AK::clamp(y(), rect.top(), rect.bottom()); + m_x = AK::clamp(x(), rect.left(), rect.left() + rect.width()); + m_y = AK::clamp(y(), rect.top(), rect.top() + rect.height()); } template