pitivi r1222 - in branches/SOC_2008_BLEWIS: . pitivi/ui



Author: edwardrv
Date: Sat Jul 26 17:17:33 2008
New Revision: 1222
URL: http://svn.gnome.org/viewvc/pitivi?rev=1222&view=rev

Log:
* pitivi/ui/ruler.py:
Fix ruler redraw again :) This time redraws as little as possible by
only forcing the redraw of the old and new curser position instead of
the whole area between the two.


Modified:
   branches/SOC_2008_BLEWIS/ChangeLog
   branches/SOC_2008_BLEWIS/pitivi/ui/ruler.py

Modified: branches/SOC_2008_BLEWIS/pitivi/ui/ruler.py
==============================================================================
--- branches/SOC_2008_BLEWIS/pitivi/ui/ruler.py	(original)
+++ branches/SOC_2008_BLEWIS/pitivi/ui/ruler.py	Sat Jul 26 17:17:33 2008
@@ -68,13 +68,13 @@
 ## timeline position changed method
 
     def timelinePositionChanged(self, value, unused_frame):
-        previous = self.position
+        ppos = max(self.nsToPixel(self.position) - 1, 0)
         self.position = value
-        orig = max(self.nsToPixel(min(value, previous)) - 5, 0) + 5
-        width = (self.nsToPixel(max(value, previous)) + 5 
-            - max(self.nsToPixel(min(value, previous)) - 5, 0))
-        self.queue_draw_area(orig, 0, width,
-                             self.get_allocation().height)
+        npos = max(self.nsToPixel(self.position) - 1, 0)
+
+        height = self.get_allocation().height
+        self.queue_draw_area(ppos, 0, 2, height)
+        self.queue_draw_area(npos, 0, 2, height)
 
 ## gtk.Widget overrides
 
@@ -207,7 +207,7 @@
         # 1/2 height: 1 second
         # 1/4 height: 1/10 second (might later be changed to 1 frame in
         #   project framerate)
- 
+
         # At the highest level of magnification, all ticmarks are visible. At
         # the lowest, only the full height tic marks are visible. The
         # appearance of text is dependent on the spacing between tics: text
@@ -216,7 +216,7 @@
 
         def textSize(text):
             return context.text_extents(text)[2:4]
- 
+
         def drawTick(paintpos, height):
             context.move_to(paintpos, 0)
             context.line_to(paintpos, allocation.height * height)
@@ -268,8 +268,9 @@
         if self.getDuration() <= 0:
             return
         # a simple RED line will do for now
-        xpos = self.nsToPixel(self.position) + self.border + 0.5
+        xpos = self.nsToPixel(self.position) + self.border
         context.save()
+        context.set_line_width(1.5)
         context.set_source_rgb(1.0, 0, 0)
 
         context.move_to(xpos, 0)



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