Skip to content

Commit c5512a4

Browse files
author
Hugo Mercier
committedJan 18, 2019
IndexExtent fix
Backport from cd1f316
1 parent f99a911 commit c5512a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎src/core/qgssnappingutils.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,12 @@ bool QgsSnappingUtils::isIndexPrepared( QgsVectorLayer *vl, const QgsRectangle &
8989
if ( mStrategy == IndexAlwaysFull && loc->hasIndex() )
9090
return true;
9191

92+
if ( mStrategy == IndexExtent && loc->hasIndex() && loc->extent()->intersects( areaOfInterest ) )
93+
return true;
94+
9295
QgsRectangle aoi( areaOfInterest );
9396
aoi.scale( 0.999 );
94-
return ( mStrategy == IndexHybrid || mStrategy == IndexExtent ) && loc->hasIndex() && ( !loc->extent() || loc->extent()->contains( aoi ) ); // the index - even if it exists - is not suitable
97+
return mStrategy == IndexHybrid && loc->hasIndex() && ( !loc->extent() || loc->extent()->contains( aoi ) ); // the index - even if it exists - is not suitable
9598
}
9699

97100
static QgsPointLocator::Match _findClosestSegmentIntersection( const QgsPointXY &pt, const QgsPointLocator::MatchList &segments )

0 commit comments

Comments
 (0)
Please sign in to comment.