Skip to content

Commit

Permalink
snapping:
Browse files Browse the repository at this point in the history
* 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 bbfcbca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/qgspointlocator.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex )


QgsFeatureRequest request; QgsFeatureRequest request;
request.setSubsetOfAttributes( QgsAttributeList() ); request.setSubsetOfAttributes( QgsAttributeList() );
request.setLimit( maxFeaturesToIndex );
if ( mExtent ) if ( mExtent )
{ {
QgsRectangle rect = *mExtent; QgsRectangle rect = *mExtent;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgssnappingutils.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ QgsPointLocator::Match QgsSnappingUtils::snapToMap( const QgsPoint& pointMap, Qg


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


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

0 comments on commit bbfcbca

Please sign in to comment.