diff --git a/Libraries/LibDraw/Point.h b/Libraries/LibDraw/Point.h index 7da91eddc2..e8516ce6c8 100644 --- a/Libraries/LibDraw/Point.h +++ b/Libraries/LibDraw/Point.h @@ -62,7 +62,22 @@ public: } Point operator-() const { return { -m_x, -m_y }; } + Point operator-(const Point& other) const { return { m_x - other.m_x, m_y - other.m_y }; } + Point& operator-=(const Point& other) + { + m_x -= other.m_x; + m_y -= other.m_y; + return *this; + } + + Point& operator+=(const Point& other) + { + m_x += other.m_x; + m_y += other.m_y; + return *this; + } + Point operator+(const Point& other) const { return { m_x + other.m_x, m_y + other.m_y }; } operator WSAPI_Point() const; String to_string() const { return String::format("[%d,%d]", x(), y()); }