Skip to content
Permalink
Browse files

fix fetching rectangle

  • Loading branch information
3nids committed Oct 25, 2018
1 parent 5577d83 commit a4e438a410c207c07f2c04c7ba38bf259049ef7e
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/gui/qgsmapcanvas.cpp
@@ -997,7 +997,7 @@ void QgsMapCanvas::zoomToSelected( QgsVectorLayer *layer )
{
int scaleFactor = 5;
QgsPointXY center = mSettings.mapToLayerCoordinates( layer, rect.center() );
QgsRectangle extentRect = mSettings.mapToLayerCoordinates( layer, extent() ).scaled( 1.0 / scaleFactor );
QgsRectangle extentRect = mSettings.mapToLayerCoordinates( layer, extent() ).scaled( 1.0 / scaleFactor, &center );
QgsFeatureRequest req = QgsFeatureRequest().setFilterRect( extentRect ).setLimit( 1000 ).setNoAttributes();
QgsFeatureIterator fit = layer->getFeatures( req );
QgsFeature f;

0 comments on commit a4e438a

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