Updated clipper so that it uses stable_sort rather then sort so results are the same across operating systems

This commit is contained in:
Blake Thompson 2015-05-26 14:40:16 -05:00
parent 91065df5f0
commit 775fcb5378
2 changed files with 3 additions and 3 deletions

View file

@ -1240,7 +1240,7 @@ void ClipperBase::Reset()
{
m_CurrentLM = m_MinimaList.begin();
if (m_CurrentLM == m_MinimaList.end()) return; //ie nothing to process
std::sort(m_MinimaList.begin(), m_MinimaList.end(), LocMinSorter());
std::stable_sort(m_MinimaList.begin(), m_MinimaList.end(), LocMinSorter());
//reset all edges ...
for (MinimaList::iterator lm = m_MinimaList.begin(); lm != m_MinimaList.end(); ++lm)
@ -2894,7 +2894,7 @@ bool Clipper::FixupIntersectionOrder()
//Now it's crucial that intersections are made only between adjacent edges,
//so to ensure this the order of intersections may need adjusting ...
CopyAELToSEL();
std::sort(m_IntersectList.begin(), m_IntersectList.end(), IntersectListSort);
std::stable_sort(m_IntersectList.begin(), m_IntersectList.end(), IntersectListSort);
size_t cnt = m_IntersectList.size();
for (size_t i = 0; i < cnt; ++i)
{

@ -1 +1 @@
Subproject commit 1b9c3932aa3d6426932f5fffa811438236cb2d0b
Subproject commit 21a45f1aa17c182dae70112b2ee50496ea158b7b