add BinPack test
This commit is contained in:
committed by
John Firebaugh
parent
8dd6da5b5e
commit
40b604448f
@@ -23,7 +23,11 @@ public:
|
||||
if (width <= ref.w && height <= ref.h) {
|
||||
if (smallest == free.end() || (ref.y <= rect.y && ref.x <= rect.x)) {
|
||||
smallest = it;
|
||||
} else {
|
||||
// Our current "smallest" rect is already closer to 0/0.
|
||||
}
|
||||
} else {
|
||||
// The rect in the free list is not big enough.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,10 +12,15 @@ struct Rect {
|
||||
T originalW = 0, originalH = 0;
|
||||
|
||||
template <typename Number>
|
||||
Rect operator *(Number value) const {
|
||||
inline Rect operator *(Number value) const {
|
||||
return Rect(x * value, y * value, w * value, h * value);
|
||||
}
|
||||
|
||||
template <typename R>
|
||||
inline bool operator==(const R& r) const {
|
||||
return x == r.x && y == r.y && w == r.w && h == r.h;
|
||||
}
|
||||
|
||||
inline bool hasArea() const { return w != 0 && h != 0; }
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user