[Greater-commits] r341 - trunk/GREAT-ER/Thuban/UI

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jun 30 18:07:28 CEST 2011


Author: aheinecke
Date: 2011-06-30 18:07:28 +0200 (Thu, 30 Jun 2011)
New Revision: 341

Modified:
   trunk/GREAT-ER/Thuban/UI/viewport.py
Log:
Avoid exception when using the mousewheel on an empty viewport


Modified: trunk/GREAT-ER/Thuban/UI/viewport.py
===================================================================
--- trunk/GREAT-ER/Thuban/UI/viewport.py	2011-06-30 13:26:32 UTC (rev 340)
+++ trunk/GREAT-ER/Thuban/UI/viewport.py	2011-06-30 16:07:28 UTC (rev 341)
@@ -377,7 +377,12 @@
         if scale is None:
             scale = self.scale
 
-        llx, lly, urx, ury = bbox = self.map.ProjectedBoundingBox()
+        bbox = self.map.ProjectedBoundingBox()
+        if not bbox:
+            #There are no layers so we have nothing to scale
+            return scale, scale
+        else:
+            llx, lly, urx, ury = bbox
         pwidth = float(urx - llx)
         pheight = float(ury - lly)
 



More information about the Greater-commits mailing list