[QGIS Commit] r14259 - trunk/qgis/src/app
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sun Sep 19 17:25:27 EDT 2010
Author: jef
Date: 2010-09-19 21:25:27 +0000 (Sun, 19 Sep 2010)
New Revision: 14259
Modified:
trunk/qgis/src/app/qgsmaptoolselectutils.cpp
Log:
apply #2973
Modified: trunk/qgis/src/app/qgsmaptoolselectutils.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolselectutils.cpp 2010-09-19 20:20:06 UTC (rev 14258)
+++ trunk/qgis/src/app/qgsmaptoolselectutils.cpp 2010-09-19 21:25:27 UTC (rev 14259)
@@ -132,6 +132,7 @@
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 @@
}
if ( singleSelect )
{
+ foundSingleFeature = true;
double distance = g->distance( selectGeomTrans );
if ( distance <= closestFeatureDist )
{
@@ -154,7 +156,7 @@
newSelectedFeatures.insert( f.id() );
}
}
- if ( singleSelect && closestFeatureId > 0 )
+ if ( singleSelect && foundSingleFeature )
{
newSelectedFeatures.insert( closestFeatureId );
}
More information about the QGIS-commit
mailing list