Skip to content

Commit

Permalink
Reshape tool should only operate on the selected features, if a selec…
Browse files Browse the repository at this point in the history
…tion is present
  • Loading branch information
github-actions[bot] authored and nyalldawson committed Oct 28, 2020
1 parent c7aa269 commit ad45f47
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/app/qgsmaptoolreshape.cpp
Expand Up @@ -23,7 +23,6 @@
#include "qgisapp.h"
#include "qgsmapmouseevent.h"


QgsMapToolReshape::QgsMapToolReshape( QgsMapCanvas *canvas )
: QgsMapToolCapture( canvas, QgisApp::instance()->cadDockWidget(), QgsMapToolCapture::CaptureLine )
{
Expand Down Expand Up @@ -128,7 +127,13 @@ void QgsMapToolReshape::reshape( QgsVectorLayer *vlayer )
QgsLineString reshapeLineString( pts );

//query all the features that intersect bounding box of capture line
QgsFeatureIterator fit = vlayer->getFeatures( QgsFeatureRequest().setFilterRect( bbox ).setNoAttributes() );
QgsFeatureRequest req = QgsFeatureRequest().setFilterRect( bbox ).setNoAttributes();

if ( vlayer->selectedFeatureCount() > 0 )
req.setFilterFids( vlayer->selectedFeatureIds() );

QgsFeatureIterator fit = vlayer->getFeatures( req );

QgsFeature f;
int reshapeReturn;
bool reshapeDone = false;
Expand Down

0 comments on commit ad45f47

Please sign in to comment.