Rect: operator method to offset by a Point.

This commit is contained in:
Jared Boone 2016-09-07 22:18:11 -07:00
parent 79330015ed
commit f722497b01
2 changed files with 6 additions and 0 deletions

View File

@ -57,4 +57,9 @@ Rect& Rect::operator+=(const Rect& p) {
return *this;
}
Rect& Rect::operator+=(const Point& p) {
pos += p;
return *this;
}
} /* namespace ui */

View File

@ -208,6 +208,7 @@ struct Rect {
}
Rect& operator+=(const Rect& p);
Rect& operator+=(const Point& p);
operator bool() const {
return !size.is_empty();