Navigation Menu

Skip to content

Commit

Permalink
Fix some labels incorrectly flagged as unplaced when they actually ar…
Browse files Browse the repository at this point in the history
…e placed
  • Loading branch information
nyalldawson committed May 1, 2020
1 parent 985dba3 commit 3e21da8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/pal/problem.cpp
Expand Up @@ -672,8 +672,10 @@ QList<LabelPosition *> Problem::getSolution( bool returnInactive, QList<LabelPos
}
else if ( unlabeled )
{
if ( mFeatStartId[i] < static_cast< int >( mLabelPositions.size() ) )
unlabeled->push_back( mLabelPositions[ mFeatStartId[i] ].get() );
const int startPos = mFeatStartId[i];
// need to be careful here -- if the next feature's start id is the same as this one, then this feature had no candidates!
if ( startPos < static_cast< int >( mLabelPositions.size() ) && ( i == mFeatureCount - 1 || startPos != mFeatStartId[i + 1] ) )
unlabeled->push_back( mLabelPositions[ startPos ].get() );
}
}

Expand Down

0 comments on commit 3e21da8

Please sign in to comment.