Skip to content
Permalink
Browse files

Fix performance issues with moving selection on canvas (Funded by goo…

…d will)

Fix #11197
  • Loading branch information
m-kuhn committed Sep 22, 2014
1 parent 96e39f7 commit 68c49fe09a4ee634d7edc3f2019e1740971ce3ca
Showing with 9 additions and 5 deletions.
  1. +2 −2 src/app/qgsmaptoolmovefeature.cpp
  2. +7 −3 src/core/qgsvectorlayer.cpp
@@ -120,9 +120,9 @@ void QgsMapToolMoveFeature::canvasPressEvent( QMouseEvent * e )
mMovedFeatures = vlayer->selectedFeaturesIds();

mRubberBand = createRubberBand( vlayer->geometryType() );
for ( int i = 0; i < vlayer->selectedFeatureCount(); i++ )
Q_FOREACH( const QgsFeature& feat, vlayer->selectedFeatures() )
{
mRubberBand->addGeometry( vlayer->selectedFeatures()[i].geometry(), vlayer );
mRubberBand->addGeometry( feat.geometry(), vlayer );
}
}

@@ -2305,10 +2305,14 @@ QgsFeatureList QgsVectorLayer::selectedFeatures()
if ( geometryType() == QGis::NoGeometry )
req.setFlags( QgsFeatureRequest::NoGeometry );

foreach ( QgsFeatureId fid, mSelectedFeatureIds )
req.setFilterFids( mSelectedFeatureIds );

QgsFeatureIterator it = getFeatures( req );

QgsFeature f;
while ( it.nextFeature( f ) )
{
features.push_back( QgsFeature() );
getFeatures( req.setFilterFid( fid ) ).nextFeature( features.back() );
features.push_back( f );
}

return features;

0 comments on commit 68c49fe

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