Skip to content
Permalink
Browse files

Fix some labels incorrectly flagged as unplaced when they actually ar…

…e placed
  • Loading branch information
nyalldawson committed Apr 30, 2020
1 parent fd3969f commit 9dec1ddb8315ed67929979dae2ab90930ee3926e
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/core/pal/problem.cpp
@@ -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() );
}
}

0 comments on commit 9dec1dd

Please sign in to comment.
You can’t perform that action at this time.