Add ioOp functions for Point and Bounds

This commit is contained in:
2017-10-12 16:09:36 -05:00
parent 507c894c15
commit 9c2e71045f
13 changed files with 136 additions and 65 deletions
+5 -5
View File
@@ -14,23 +14,23 @@ Bounds::Bounds() {
}
bool Bounds::intersects(Bounds o) const {
return o.x2() >= X && x2() >= o.X && o.y2() >= Y && y2() >= o.Y;
return o.x2() >= x && x2() >= o.x && o.y2() >= y && y2() >= o.y;
}
bool Bounds::contains(int x, int y) const {
return x >= X && y >= Y && x <= x2() && y <= y2();
return x >= this->x && y >= this->y && x <= x2() && y <= y2();
}
int Bounds::x2() const {
return X + Width;
return x + width;
}
int Bounds::y2() const {
return Y + Height;
return y + height;
}
Point Bounds::pt1() {
return Point(X, Y);
return Point(x, y);
}
Point Bounds::pt2() {