Skip to content

Commit fce6603

Browse files
author
g_j_m
committedAug 17, 2006
Fix for ticket #238 (zoom to map fails on startup). If there are no command line
arguments, the extent is -1,-1,1,1, but if there, the extent is determined by t he layers loaded. git-svn-id: http://svn.osgeo.org/qgis/trunk@5703 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b61cda3 commit fce6603

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎src/gui/main.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,13 @@ int main(int argc, char *argv[])
230230
// save the image to disk and then exit
231231
QString mySnapshotFileName="";
232232

233-
// This behaviour will set initial extent of map canvas
234-
QString myInitialExtent="-1,-1,1,1";
233+
// This behaviour will set initial extent of map canvas, but only if
234+
// there are no command line arguments. This gives a usable map
235+
// extent when qgis starts with no layers loaded. When layers are
236+
// loaded, we let the layers define the initial extent.
237+
QString myInitialExtent="";
238+
if (argc == 1)
239+
myInitialExtent="-1,-1,1,1";
235240

236241
// This behaviour will allow you to force the use of a translation file
237242
// which is useful for testing

0 commit comments

Comments
 (0)
Please sign in to comment.