jonathan: thuban/Thuban/Model layer.py,1.63,1.64

cvs@intevation.de cvs at intevation.de
Wed Mar 23 16:30:29 CET 2005


Author: jonathan

Update of /thubanrepository/thuban/Thuban/Model
In directory doto:/tmp/cvs-serv32375/Thuban/Model

Modified Files:
	layer.py 
Log Message:
Add support for adjusting the opacity of a raster layer.


Index: layer.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/Model/layer.py,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- layer.py	16 Feb 2005 21:14:47 -0000	1.63
+++ layer.py	23 Mar 2005 15:30:27 -0000	1.64
@@ -372,7 +372,7 @@
         self.bbox = -1
 
         self.mask_type = self.MASK_BIT
-        self.alpha_opacity = 1
+        self.opacity = 1
 
         self.image_info = None
 
@@ -481,16 +481,12 @@
             self.mask_type = type
             self.changed(LAYER_CHANGED, self)
 
-    def AlphaOpacity(self):
-        """Return the level of opacity used in alpha blending, or None
-        if mask type is not MASK_ALPHA.
+    def Opacity(self):
+        """Return the level of opacity used in alpha blending.
         """
-        if self.mask_type == self.MASK_ALPHA:
-            return self.alpha_opacity
-        else:
-            return None
+        return self.opacity
 
-    def SetAlphaOpacity(self, op):
+    def SetOpacity(self, op):
         """Set the level of alpha opacity. 
 
         0 <= op <= 1.
@@ -500,7 +496,9 @@
         if not (0 <= op <= 1):
             raise ValueError("op out of range")
 
-        self.alpha_opacity = op
+        if op != self.opacity: 
+            self.opacity = op
+            self.changed(LAYER_CHANGED, self)
 
     def ImageInfo(self):
         return self.image_info





More information about the Thuban-devel mailing list

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