[hamster-applet/2_28_no_bars] simplified fill_area



commit aa666ddf1de8109d438c22c9687c0ee1b24e8230
Author: Toms Bauģis <toms baugis gmail com>
Date:   Tue Nov 10 20:25:18 2009 +0000

    simplified fill_area

 hamster/graphics.py |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/hamster/graphics.py b/hamster/graphics.py
index 4e2cf3a..9336b2d 100644
--- a/hamster/graphics.py
+++ b/hamster/graphics.py
@@ -170,7 +170,7 @@ class Area(gtk.DrawingArea):
                 return y
         return x, y            
         
-    def __rectangle(self, x, y, w, h, color, opacity = 0):
+    def __rectangle(self, x, y, w, h, color):
         if color[0] > 1: color = [c / 256.0 for c in color]
 
         if opacity:
@@ -183,10 +183,9 @@ class Area(gtk.DrawingArea):
         self.context.rectangle(x, y, w, h)
     
     def fill_area(self, x, y, w, h, color, opacity = 0):
-        self.context.save()
-        self.__rectangle(x, y, w, h, color, opacity)
+        self.context.set_source_rgb(*color)
+        self.context.rectangle(x, y, w, h)
         self.context.fill()
-        self.context.restore()
         
     def fill_rectangle(self, x, y, w, h, color, opacity = 0):
         self.context.save()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]