Core/GuillotineBinPack: Fix search error

Former-commit-id: 8b7428f59b0a1258c8096df2f784910523dee79d
This commit is contained in:
Lynix 2015-11-26 23:57:48 +01:00
parent 1e5cad5b24
commit 5d3e4d7aeb
1 changed files with 4 additions and 4 deletions

View File

@ -154,7 +154,7 @@ namespace Nz
bool bestFlipped; bool bestFlipped;
std::size_t bestFreeRect; std::size_t bestFreeRect;
std::size_t bestRect; std::size_t bestRect;
std::size_t bestScore = std::numeric_limits<std::size_t>::max(); int bestScore = std::numeric_limits<int>::max();
for (std::size_t i = 0; i < m_freeRectangles.size(); ++i) for (std::size_t i = 0; i < m_freeRectangles.size(); ++i)
{ {
@ -170,7 +170,7 @@ namespace Nz
bestFreeRect = i; bestFreeRect = i;
bestRect = j; bestRect = j;
bestFlipped = false; bestFlipped = false;
bestScore = std::numeric_limits<std::size_t>::min(); bestScore = std::numeric_limits<int>::min();
i = m_freeRectangles.size(); // Force a jump out of the outer loop as well - we got an instant fit. i = m_freeRectangles.size(); // Force a jump out of the outer loop as well - we got an instant fit.
break; break;
} }
@ -180,7 +180,7 @@ namespace Nz
bestFreeRect = i; bestFreeRect = i;
bestRect = j; bestRect = j;
bestFlipped = true; bestFlipped = true;
bestScore = std::numeric_limits<std::size_t>::min(); bestScore = std::numeric_limits<int>::min();
i = m_freeRectangles.size(); // Force a jump out of the outer loop as well - we got an instant fit. i = m_freeRectangles.size(); // Force a jump out of the outer loop as well - we got an instant fit.
break; break;
} }
@ -212,7 +212,7 @@ namespace Nz
} }
// If we didn't manage to find any rectangle to pack, abort. // If we didn't manage to find any rectangle to pack, abort.
if (bestScore == std::numeric_limits<std::size_t>::max()) if (bestScore == std::numeric_limits<int>::max())
{ {
// Si nous le pouvons, on marque les rectangles n'ayant pas pu être insérés // Si nous le pouvons, on marque les rectangles n'ayant pas pu être insérés
if (inserted) if (inserted)