bh: thuban/Thuban/UI baserenderer.py,1.9,1.9.2.1

cvs@intevation.de cvs at intevation.de
Fri Aug 6 20:12:41 CEST 2004


Author: bh

Update of /thubanrepository/thuban/Thuban/UI
In directory doto:/tmp/cvs-serv7661/Thuban/UI

Modified Files:
      Tag: thuban-1-0-branch
	baserenderer.py 
Log Message:
Backport some fixes from HEAD:

Fix some typos in comments and doc-strings
(BaseRenderer.render_map_incrementally): Fix a logic bug in the
optimization that tries not to draw layers under a raster layer.  The
bug was harmless.  All it effectively did was to produce strange
messages about not being able to draw Layer instances for all vector
layers below a raster layer.  Those layers would be invisible anyway
because the raster layer currently always covers the entire window


Index: baserenderer.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/UI/baserenderer.py,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -d -r1.9 -r1.9.2.1
--- baserenderer.py	11 Nov 2003 18:16:20 -0000	1.9
+++ baserenderer.py	6 Aug 2004 18:12:39 -0000	1.9.2.1
@@ -1,4 +1,4 @@
-# Copyright (c) 2001, 2002, 2003 by Intevation GmbH
+# Copyright (c) 2001, 2002, 2003, 2004 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh at intevation.de>
 # Jonathan Coles <jonathan at intevation.de>
@@ -42,7 +42,7 @@
 # (layer_class, draw_function) pairs. If the renderer has to draw a
 # non-builtin layer type, i.e. a layer that is not a subclass of Layer
 # or RasterLayer, it iterates through that list, tests whether the layer
-# to be drawin is an instance of layer_class and if so calls
+# to be drawn is an instance of layer_class and if so calls
 # draw_function with the renderer and the layer as arguments. Since
 # drawing is done incrementally, the draw_function should return an
 # iterable. The easiest way is to simply implement the draw_function as
@@ -64,7 +64,7 @@
     function should return an iterable. The easiest way is to simply
     implement the draw_function as a generator and to yield True in
     suitable places, or to return the empty tuple if it's not possible
-    to do the rendering in incrementally.
+    to do the rendering incrementally.
     """
     _renderer_extensions.append((layer_class, function))
 
@@ -198,9 +198,10 @@
             # if honor_visibility is true, only draw visible layers,
             # otherwise draw all layers
             if not self.honor_visibility or layer.Visible():
-                if isinstance(layer, Layer) and seenRaster:
-                    for i in self.draw_shape_layer_incrementally(layer):
-                        yield True
+                if isinstance(layer, Layer):
+                    if seenRaster:
+                        for i in self.draw_shape_layer_incrementally(layer):
+                            yield True
                 elif isinstance(layer, RasterLayer) \
                     and Thuban.Model.resource.has_gdal_support():
                     self.draw_raster_layer(layer)





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)