[Thuban-commits] r2891 - trunk/thuban/Thuban/UI

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jul 14 12:45:34 CEST 2011


Author: bricks
Date: 2011-07-14 12:45:33 +0200 (Thu, 14 Jul 2011)
New Revision: 2891

Modified:
   trunk/thuban/Thuban/UI/viewport.py
Log:
Scale correctly if no bounding box is available

Modified: trunk/thuban/Thuban/UI/viewport.py
===================================================================
--- trunk/thuban/Thuban/UI/viewport.py	2009-09-27 20:38:23 UTC (rev 2890)
+++ trunk/thuban/Thuban/UI/viewport.py	2011-07-14 10:45:33 UTC (rev 2891)
@@ -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 Thuban-commits mailing list