mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
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:
parent
a165cb609a
commit
f082966d64
@ -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 )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user