Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Correctly expand single-click search rect for show/hide label tool
  • Loading branch information
nyalldawson committed Jul 23, 2019
1 parent d8a3031 commit baf2006
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/qgsmaptoolshowhidelabels.cpp
Expand Up @@ -220,7 +220,15 @@ bool QgsMapToolShowHideLabels::selectedFeatures( QgsVectorLayer *vlayer,
{
// culled from QgsMapToolSelectUtils::setSelectFeatures()

QgsGeometry selectGeometry = mRubberBand->asGeometry();
QgsGeometry selectGeometry;
if ( mDragging )
{
selectGeometry = mRubberBand->asGeometry();
}
else
{
selectGeometry = QgsGeometry::fromRect( QgsMapToolSelectUtils::expandSelectRectangle( mRubberBand->asGeometry().centroid().asPoint(), canvas(), vlayer ) );
}

// toLayerCoordinates will throw an exception for any 'invalid' points in
// the rubber band.
Expand Down

0 comments on commit baf2006

Please sign in to comment.