Set obstacle geometry to original geometry

This commit is contained in:
Matthias Kuhn 2019-03-12 08:54:19 +01:00
parent e19527c369
commit 486bb75ca8
No known key found for this signature in database
GPG Key ID: 7A7F1A1C90C3E6A7

View File

@ -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 );
}