Skip to content

Commit

Permalink
Set obstacle geometry to original geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Mar 12, 2019
1 parent e19527c commit 486bb75
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/qgspallabeling.cpp
Expand Up @@ -1338,6 +1338,15 @@ void QgsPalLayerSettings::registerFeature( const QgsFeature &f, QgsRenderContext
if ( mGeometryGeneratorExpression.hasEvalError() )
QgsMessageLog::logMessage( QObject::tr( "Labeling" ), mGeometryGeneratorExpression.evalErrorString() );

if ( obstacleGeometry.isNull() )
{
// if an explicit obstacle geometry hasn't been set, we must always use the original feature geometry
// as the obstacle -- because we want to use the geometry which was used to render the symbology
// for the feature as the obstacle for other layers' labels, NOT the generated geometry which is used
// only to place labels for this layer.
obstacleGeometry = f.geometry();
}

feature.setGeometry( geometry );
}

Expand Down

0 comments on commit 486bb75

Please sign in to comment.