Skip to content
Permalink
Browse files

snapping:

* skip index build if snapping is off
* use feature request limit when creating the snapping index
  • Loading branch information
jef-n committed Jan 24, 2016
1 parent 8ad6ca0 commit bbfcbcae107761254d7bd8ee8389482cc9760d49
Showing with 2 additions and 1 deletion.
  1. +1 −0 src/core/qgspointlocator.cpp
  2. +1 −1 src/core/qgssnappingutils.cpp
@@ -642,6 +642,7 @@ bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex )

QgsFeatureRequest request;
request.setSubsetOfAttributes( QgsAttributeList() );
request.setLimit( maxFeaturesToIndex );
if ( mExtent )
{
QgsRectangle rect = *mExtent;
@@ -214,7 +214,7 @@ QgsPointLocator::Match QgsSnappingUtils::snapToMap( const QgsPoint& pointMap, Qg

if ( mSnapToMapMode == SnapCurrentLayer )
{
if ( !mCurrentLayer )
if ( !mCurrentLayer || mDefaultType == 0 )
return QgsPointLocator::Match();

prepareIndex( QList<QgsVectorLayer*>() << mCurrentLayer );

0 comments on commit bbfcbca

Please sign in to comment.
You can’t perform that action at this time.