From 486bb75ca83b6a85d61badbc85f2abc6a685f878 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 12 Mar 2019 08:54:19 +0100 Subject: [PATCH] Set obstacle geometry to original geometry --- src/core/qgspallabeling.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/qgspallabeling.cpp b/src/core/qgspallabeling.cpp index f58b7564c30..0fd51327aaf 100644 --- a/src/core/qgspallabeling.cpp +++ b/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 ); }