Skip to content
Permalink
Browse files

Set obstacle geometry to original geometry

  • Loading branch information
m-kuhn committed Mar 12, 2019
1 parent e19527c commit 486bb75ca83b6a85d61badbc85f2abc6a685f878
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/core/qgspallabeling.cpp
@@ -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 );
}

0 comments on commit 486bb75

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