Fix arrangement with items larger or equal to bed dimesions.

fixes #2897 
fixes #1186
This commit is contained in:
tamasmeszaros 2020-03-16 14:37:54 +01:00
parent 6bace46be1
commit 5ed7d0aa29
2 changed files with 5 additions and 2 deletions

View file

@ -43,7 +43,10 @@ protected:
Placer p{bin};
p.configure(pcfg);
if (itm.area() <= 0 || !p.pack(cpy)) it = c.erase(it);
if (itm.area() <= 0 || !p.pack(cpy)) {
static_cast<Item&>(*it).binId(BIN_ID_UNSET);
it = c.erase(it);
}
else it++;
}
}

View file

@ -577,7 +577,7 @@ void _arrange(
std::function<bool()> stopfn)
{
// Integer ceiling the min distance from the bed perimeters
coord_t md = minobjd - 2 * scaled(0.1 + EPSILON);
coord_t md = minobjd;
md = (md % 2) ? md / 2 + 1 : md / 2;
auto corrected_bin = bin;