Skip to content

Commit 871ea87

Browse files
committedJul 8, 2016
Fix deselecting features by clicking no feature
1 parent ea3fc65 commit 871ea87

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎src/app/qgsmaptoolselectutils.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ void QgsMapToolSelectUtils::selectSingleFeature( QgsMapCanvas* canvas, QgsGeomet
110110
QgsFeatureIds selectedFeatures = getMatchingFeatures( canvas, selectGeometry, false, true );
111111
if ( selectedFeatures.isEmpty() )
112112
{
113+
if ( !( e->modifiers() & Qt::ShiftModifier || e->modifiers() & Qt::ControlModifier ) )
114+
{
115+
// if no modifiers then clicking outside features clears the selection
116+
// but if there's a shift or ctrl modifier, then it's likely the user was trying
117+
// to modify an existing selection by adding or subtracting features and just
118+
// missed the feature
119+
vlayer->removeSelection();
120+
}
113121
QApplication::restoreOverrideCursor();
114122
return;
115123
}

0 commit comments

Comments
 (0)
Please sign in to comment.