Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
The test was using a non-real-world situation where we were
setting the flag to render label rects only, but then trying
to also retrieve the label results.
  • Loading branch information
nyalldawson committed Dec 3, 2024
1 parent 585a3d8 commit 2f35db3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/core/labeling/qgslabelingengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,14 @@ void QgsLabelingEngine::drawLabels( QgsRenderContext &context, const QString &la
{
drawLabelRect( label );
}

if ( settings.testFlag( Qgis::LabelingFlag::DrawUnplacedLabels ) )
{
for ( pal::LabelPosition *label : std::as_const( mUnlabeled ) )
{
drawLabelRect( label );
}
}
}
else
{
Expand Down
2 changes: 0 additions & 2 deletions tests/src/core/testqgslabelingengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4209,7 +4209,6 @@ void TestQgsLabelingEngine::labelingResults()

QgsLabelingEngineSettings engineSettings = mapSettings.labelingEngineSettings();
engineSettings.setFlag( Qgis::LabelingFlag::UsePartialCandidates, false );
engineSettings.setFlag( Qgis::LabelingFlag::DrawLabelRectOnly, true );
//engineSettings.setFlag( Qgis::LabelingFlag::DrawCandidates, true );
mapSettings.setLabelingEngineSettings( engineSettings );

Expand Down Expand Up @@ -4415,7 +4414,6 @@ void TestQgsLabelingEngine::labelingResultsCurved()

QgsLabelingEngineSettings engineSettings = mapSettings.labelingEngineSettings();
engineSettings.setFlag( Qgis::LabelingFlag::UsePartialCandidates, false );
engineSettings.setFlag( Qgis::LabelingFlag::DrawLabelRectOnly, true );
//engineSettings.setFlag( Qgis::LabelingFlag::DrawCandidates, true );
mapSettings.setLabelingEngineSettings( engineSettings );

Expand Down

0 comments on commit 2f35db3

Please sign in to comment.