Skip to content
Permalink
Browse files
fix #1008
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8268 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 25, 2008
1 parent 53ad04e commit 680499ddaf581de49fb8b84638bde47892ec8306
Showing with 15 additions and 9 deletions.
  1. +15 −9 src/gui/qgsmapcanvas.cpp
@@ -443,17 +443,23 @@ void QgsMapCanvas::updateFullExtent()
void QgsMapCanvas::setExtent(QgsRect const & r)
{
if(mDrawing)
{
return;
}

if (r.isEmpty())
{
QgsDebugMsg("Setting empty extent!");
return;
}

QgsRect current = extent();
mMapRender->setExtent(r);

QgsRect current = extent();

if (r.isEmpty())
{
QgsDebugMsg("Empty extent - keeping old extent with new center!");
QgsRect e( QgsPoint( r.center().x()-current.width()/2.0, r.center().y()-current.height()/2.0 ),
QgsPoint( r.center().x()+current.width()/2.0, r.center().y()+current.height()/2.0 ) );
mMapRender->setExtent(e);
}
else
{
mMapRender->setExtent(r);
}
emit extentsChanged();
updateScale();
if (mMapOverview)

0 comments on commit 680499d

Please sign in to comment.