[hamster-applet] round also selection rectangle coordinates for those magical dissappearance cases



commit 8f3704a179c49dd6bcd135bc0c16abc9913ccd51
Author: Toms Bauģis <toms baugis gmail com>
Date:   Fri Nov 20 12:07:38 2009 +0000

    round also selection rectangle coordinates for those magical dissappearance cases

 hamster/widgets/dayline.py |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/hamster/widgets/dayline.py b/hamster/widgets/dayline.py
index 15b90ee..993a7f9 100644
--- a/hamster/widgets/dayline.py
+++ b/hamster/widgets/dayline.py
@@ -311,16 +311,17 @@ class DayLine(graphics.Area):
         
         #highlight rectangle
         if self.highlight:
-            self.highlight_start = self.get_pixel(self._minutes_from_start(self.highlight[0]))
-            self.highlight_end = self.get_pixel(self._minutes_from_start(self.highlight[1]))
+            self.highlight_start = round(self.get_pixel(self._minutes_from_start(self.highlight[0])))
+            self.highlight_end = round(self.get_pixel(self._minutes_from_start(self.highlight[1])))
 
         #TODO - make a proper range check here
         if self.highlight_end > 0 and self.highlight_start < self.width:
             rgb = colorsys.hls_to_rgb(.6, .7, .5)
 
-
-            self.fill_area(self.highlight_start, graph_y,
-                           self.highlight_end - self.highlight_start, graph_height,
+            self.fill_area(self.highlight_start,
+                           graph_y,
+                           self.highlight_end - self.highlight_start,
+                           graph_height,
                            (rgb[0], rgb[1], rgb[2], 0.5))
             context.stroke()
 



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