Skip to content

Commit

Permalink
When loading a project file, restore the canvas extent to that provid…
Browse files Browse the repository at this point in the history
…ed 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@5613 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
morb_au committed Jul 20, 2006
1 parent 79023aa commit 3b840fb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gui/qgsproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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 )
{
Expand Down

0 comments on commit 3b840fb

Please sign in to comment.