FIX: auto-arrange fails in several cases

Jira: STUDIO-644, STUDIO-661

Change-Id: I3cd1fcd4e1fabf9a401c9fd536e8f55592775fbd
This commit is contained in:
arthur 2022-08-09 01:52:15 +08:00 committed by Lane.Wei
parent 1e0301dbde
commit 35d6e048ff
2 changed files with 17 additions and 12 deletions

View file

@ -67,7 +67,7 @@ struct NfpPConfig {
* the already packed items.
*
*/
std::function<double(const _Item<RawShape>&)> object_function;
std::function<double(const _Item<RawShape>&, const ItemGroup&)> object_function;
/**
* @brief The quality of search for an optimal placement.
@ -666,7 +666,7 @@ private:
// This is the kernel part of the object function that is
// customizable by the library client
std::function<double(const Item&)> _objfunc;
if(config_.object_function) _objfunc = config_.object_function;
if (config_.object_function) _objfunc = [this](const Item& item) {return config_.object_function(item, this->items_); };
else {
// Inside check has to be strict if no alignment was enabled