Skip to content
Permalink
Browse files
[processing] Fix unplaced label logic in the extract labels algorithm
  • Loading branch information
nirvn committed Jan 6, 2022
1 parent 92c1ed4 commit eae200078339f37124d5c1753489efe1e2294a7c
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/analysis/processing/qgsalgorithmextractlabels.cpp
@@ -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() )
{
@@ -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;

0 comments on commit eae2000

Please sign in to comment.