Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 680499d
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit 680499d

Please sign in to comment.