We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 8eab61d commit ffd7f8aCopy full SHA for ffd7f8a
src/gui/qgsmapcanvas.cpp
@@ -843,6 +843,14 @@ void QgsMapCanvas::setExtent( QgsRectangle const & r )
843
844
if ( r.isEmpty() )
845
{
846
+ if ( !mSettings.hasValidSettings() )
847
+ {
848
+ // we can't even just move the map center
849
+ QgsDebugMsg( "Empty extent - ignoring" );
850
+ return;
851
+ }
852
+
853
+ // ### QGIS 3: do not allow empty extent - require users to call setCenter() explicitly
854
QgsDebugMsg( "Empty extent - keeping old scale with new center!" );
855
setCenter( r.center() );
856
}
0 commit comments