Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix fetching rectangle
  • Loading branch information
3nids committed Oct 25, 2018
1 parent 5577d83 commit a4e438a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/qgsmapcanvas.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit a4e438a

Please sign in to comment.