implement naive packer

This commit is contained in:
Fabien Freling 2022-02-15 21:18:50 +01:00
parent 8698cf8160
commit e31683d2fe
8 changed files with 114 additions and 78 deletions

View file

@ -2,21 +2,12 @@
namespace freling {
int BoundingBox::width() const {
return right - left;
}
int BoundingBox::height() const {
return bottom - top;
}
int BoundingBox::area() const {
return width() * height();
return width * height;
}
bool BoundingBox::operator==(const BoundingBox& b) const {
return left == b.left and top == b.top and right == b.right and
bottom == b.bottom;
return x == b.x and y == b.y and width == b.width and height == b.height;
}
} // namespace freling