Skip to content

Commit 486bb75

Browse files
committedMar 12, 2019
Set obstacle geometry to original geometry
1 parent e19527c commit 486bb75

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎src/core/qgspallabeling.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,15 @@ void QgsPalLayerSettings::registerFeature( const QgsFeature &f, QgsRenderContext
13381338
if ( mGeometryGeneratorExpression.hasEvalError() )
13391339
QgsMessageLog::logMessage( QObject::tr( "Labeling" ), mGeometryGeneratorExpression.evalErrorString() );
13401340

1341+
if ( obstacleGeometry.isNull() )
1342+
{
1343+
// if an explicit obstacle geometry hasn't been set, we must always use the original feature geometry
1344+
// as the obstacle -- because we want to use the geometry which was used to render the symbology
1345+
// for the feature as the obstacle for other layers' labels, NOT the generated geometry which is used
1346+
// only to place labels for this layer.
1347+
obstacleGeometry = f.geometry();
1348+
}
1349+
13411350
feature.setGeometry( geometry );
13421351
}
13431352

0 commit comments

Comments
 (0)
Please sign in to comment.