Skip to content

Commit

Permalink
Don't lock canvas when trying to pan to null geometry
Browse files Browse the repository at this point in the history
Fix #15122
  • Loading branch information
m-kuhn committed Jun 26, 2016
1 parent 88fc149 commit 0bac4b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/qgsmapcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ QgsRectangle QgsMapCanvas::fullExtent() const
} // extent


void QgsMapCanvas::setExtent( QgsRectangle const & r, bool magnified )
void QgsMapCanvas::setExtent( const QgsRectangle& r, bool magnified )
{
QgsRectangle current = extent();

Expand Down Expand Up @@ -1206,8 +1206,8 @@ void QgsMapCanvas::panToSelected( QgsVectorLayer* layer )
return;

QgsRectangle rect = mapSettings().layerExtentToOutputExtent( layer, layer->boundingBoxOfSelected() );
setExtent( QgsRectangle( rect.center(), rect.center() ) );
refresh();
if ( !rect.isNull() )
setCenter( rect.center() );
} // panToSelected

void QgsMapCanvas::keyPressEvent( QKeyEvent * e )
Expand Down

0 comments on commit 0bac4b8

Please sign in to comment.