Skip to content

Commit

Permalink
[processing] Fix unplaced label logic in the extract labels algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jan 6, 2022
1 parent 92c1ed4 commit eae2000
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/analysis/processing/qgsalgorithmextractlabels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ class ExtractLabelSink : public QgsLabelSink

void drawLabel( const QString &layerId, QgsRenderContext &context, pal::LabelPosition *label, const QgsPalLayerSettings &settings ) override
{
processLabel( layerId, context, label, settings );
processLabel( layerId, context, label, settings, false );
}

void drawUnplacedLabel( const QString &layerId, QgsRenderContext &context, pal::LabelPosition *label, const QgsPalLayerSettings &settings ) override
{
processLabel( layerId, context, label, settings );
processLabel( layerId, context, label, settings, true );
}

void processLabel( const QString &layerId, QgsRenderContext &context, pal::LabelPosition *label, const QgsPalLayerSettings &settings )
void processLabel( const QString &layerId, QgsRenderContext &context, pal::LabelPosition *label, const QgsPalLayerSettings &settings, bool unplacedLabel )
{
if ( mFeedback->isCanceled() )
{
Expand Down Expand Up @@ -255,7 +255,7 @@ class ExtractLabelSink : public QgsLabelSink

QgsAttributes attributes;
attributes << mMapLayerNames.value( layerId ) << fid
<< labelText << label->getWidth() << label->getHeight() << labelRotation << label->conflictsWithObstacle()
<< labelText << label->getWidth() << label->getHeight() << labelRotation << unplacedLabel
<< fontFamily << fontSize << fontItalic << fontBold << fontUnderline << fontStyle << fontLetterSpacing << fontWordSpacing
<< labelAlignment << formatLineHeight << formatColor << formatOpacity;

Expand Down

0 comments on commit eae2000

Please sign in to comment.