When loading a project file, restore the canvas extent to that provided in the project file (i.e. the extent in existence when the project file was saved). Previously the extent was the maximum extent across all layers.

I'm not sure why this functionality hasn't been done before, as it seemed so trivial to implement?

The main benefit to its implementation is that in large layers, the user doesn't have to wait for the whole layer to draw before he can restart work on a project (which is particularly important since we currently can no longer hit Esc to halt a redraw).



git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5613 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
morb_au 2006-07-20 01:17:51 +00:00
parent a165cb609a
commit f082966d64

View File

@ -1098,6 +1098,8 @@ bool QgsProject::read()
// get the map layers
pair< bool, list<QDomNode> > getMapLayersResults = _getMapLayers(*doc);
// Restore the map canvas extent
QgsRect savedExtent;
if (!_getExtents(*doc, savedExtent))
@ -1114,6 +1116,15 @@ bool QgsProject::read()
// return false;
}
else
{
if (canvas)
{
canvas->setExtent(savedExtent);
}
}
// review the integrity of the retrieved map layers
if ( ! getMapLayersResults.first )
{