Skip to content

Commit

Permalink
Fix unnecessary calculations performed when a layer is set not to be …
Browse files Browse the repository at this point in the history
…an obstacle for other labels

(cherry picked from commit fc79502)
  • Loading branch information
nyalldawson committed Aug 6, 2019
1 parent 090fa24 commit d07e709
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/pal/layer.cpp
Expand Up @@ -200,7 +200,7 @@ bool Layer::registerFeature( QgsLabelFeature *lf )
addedFeature = true;
}

if ( !featureGeomIsObstacleGeom )
if ( lf->isObstacle() && !featureGeomIsObstacleGeom )
{
//do the same for the obstacle geometry
simpleGeometries.reset( Util::unmulti( lf->obstacleGeometry() ) );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgspallabeling.cpp
Expand Up @@ -1715,7 +1715,7 @@ void QgsPalLayerSettings::registerFeature( const QgsFeature &f, QgsRenderContext
}

geos::unique_ptr geosObstacleGeomClone;
if ( !obstacleGeometry.isNull() )
if ( isObstacle && !obstacleGeometry.isNull() )
{
geosObstacleGeomClone = QgsGeos::asGeos( obstacleGeometry );
}
Expand Down

0 comments on commit d07e709

Please sign in to comment.