mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-12 00:02:25 -04:00
Fix unnecessary calculations performed when a layer is set not to be an obstacle for other labels
This commit is contained in:
parent
5931933b41
commit
fc79502763
@ -199,7 +199,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() ) );
|
||||
|
@ -1964,7 +1964,7 @@ void QgsPalLayerSettings::registerFeature( const QgsFeature &f, QgsRenderContext
|
||||
}
|
||||
|
||||
geos::unique_ptr geosObstacleGeomClone;
|
||||
if ( !obstacleGeometry.isNull() )
|
||||
if ( isObstacle && !obstacleGeometry.isNull() )
|
||||
{
|
||||
geosObstacleGeomClone = QgsGeos::asGeos( obstacleGeometry );
|
||||
}
|
||||
@ -2442,7 +2442,7 @@ void QgsPalLayerSettings::registerFeature( const QgsFeature &f, QgsRenderContext
|
||||
( *labelFeature )->setIsObstacle( isObstacle );
|
||||
|
||||
double featObstacleFactor = obstacleFactor;
|
||||
if ( mDataDefinedProperties.isActive( QgsPalLayerSettings::ObstacleFactor ) )
|
||||
if ( isObstacle && mDataDefinedProperties.isActive( QgsPalLayerSettings::ObstacleFactor ) )
|
||||
{
|
||||
context.expressionContext().setOriginalValueVariable( featObstacleFactor );
|
||||
exprVal = mDataDefinedProperties.value( QgsPalLayerSettings::ObstacleFactor, context.expressionContext() );
|
||||
|
Loading…
x
Reference in New Issue
Block a user