map regions in origin
This commit is contained in:
parent
38e9a97a85
commit
4447cd67d1
7 changed files with 82 additions and 12 deletions
|
@ -5,6 +5,10 @@ namespace freling {
|
|||
int BoundingBox::area() const {
|
||||
return width * height;
|
||||
}
|
||||
bool BoundingBox::contains(int x, int y) const {
|
||||
return this->x <= x and x <= this->x + this->width and this->y <= y and
|
||||
y <= this->y + this->height;
|
||||
}
|
||||
|
||||
bool BoundingBox::operator==(const BoundingBox& b) const {
|
||||
return x == b.x and y == b.y and width == b.width and height == b.height;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue