Skip to content

Commit

Permalink
Fix deselecting features by clicking no feature
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 8, 2016
1 parent ea3fc65 commit 871ea87
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/qgsmaptoolselectutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ void QgsMapToolSelectUtils::selectSingleFeature( QgsMapCanvas* canvas, QgsGeomet
QgsFeatureIds selectedFeatures = getMatchingFeatures( canvas, selectGeometry, false, true );
if ( selectedFeatures.isEmpty() )
{
if ( !( e->modifiers() & Qt::ShiftModifier || e->modifiers() & Qt::ControlModifier ) )
{
// if no modifiers then clicking outside features clears the selection
// but if there's a shift or ctrl modifier, then it's likely the user was trying
// to modify an existing selection by adding or subtracting features and just
// missed the feature
vlayer->removeSelection();
}
QApplication::restoreOverrideCursor();
return;
}
Expand Down

0 comments on commit 871ea87

Please sign in to comment.