Skip to content
Permalink
Browse files

Reshape tool should only operate on the selected features, if a selec…

…tion is present

Fixes #23088
  • Loading branch information
nyalldawson committed Oct 28, 2020
1 parent 37de804 commit ad01045f0f7838254ef392efdc48ee32988258ff
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/app/qgsmaptoolreshape.cpp
@@ -23,7 +23,6 @@
#include "qgisapp.h"
#include "qgsmapmouseevent.h"


QgsMapToolReshape::QgsMapToolReshape( QgsMapCanvas *canvas )
: QgsMapToolCapture( canvas, QgisApp::instance()->cadDockWidget(), QgsMapToolCapture::CaptureLine )
{
@@ -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;

0 comments on commit ad01045

Please sign in to comment.
You can’t perform that action at this time.