Skip to content
Permalink
Browse files
apply #2973
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14259 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 19, 2010
1 parent f2db6a5 commit 8fcdc2f0ea158cb32850942e9a401c27753d2af9
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/app/qgsmaptoolselectutils.cpp
@@ -132,6 +132,7 @@ void QgsMapToolSelectUtils::setSelectFeatures( QgsMapCanvas* canvas,
QgsFeatureIds newSelectedFeatures;
QgsFeature f;
int closestFeatureId = 0;
bool foundSingleFeature = false;
double closestFeatureDist = std::numeric_limits<double>::max();
while ( vlayer->nextFeature( f ) )
{
@@ -142,6 +143,7 @@ void QgsMapToolSelectUtils::setSelectFeatures( QgsMapCanvas* canvas,
}
if ( singleSelect )
{
foundSingleFeature = true;
double distance = g->distance( selectGeomTrans );
if ( distance <= closestFeatureDist )
{
@@ -154,7 +156,7 @@ void QgsMapToolSelectUtils::setSelectFeatures( QgsMapCanvas* canvas,
newSelectedFeatures.insert( f.id() );
}
}
if ( singleSelect && closestFeatureId > 0 )
if ( singleSelect && foundSingleFeature )
{
newSelectedFeatures.insert( closestFeatureId );
}

0 comments on commit 8fcdc2f

Please sign in to comment.