[pitivi: 1/3] pitivi/ui/curve.py: use save/restore instead of reset_clip in simple_paint



commit a9795568f5a0adca5a4277bf51868a5a30ff99dd
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date:   Tue Apr 6 10:59:58 2010 -0700

    pitivi/ui/curve.py: use save/restore instead of reset_clip in simple_paint
    
    closes bug 612501, as we avoid calling the improperly-wrapped
    cr.restore() method

 pitivi/ui/curve.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/ui/curve.py b/pitivi/ui/curve.py
index 68b7b6b..17ddcab 100644
--- a/pitivi/ui/curve.py
+++ b/pitivi/ui/curve.py
@@ -214,7 +214,7 @@ class Curve(goocanvas.ItemSimple, goocanvas.Item, View, Zoomable):
         self.keyframes[kf] = pos
 
     def do_simple_paint(self, cr, bounds):
-
+        cr.save()
         cr.identity_matrix()
         if self.interpolator:
 
@@ -258,17 +258,21 @@ class Curve(goocanvas.ItemSimple, goocanvas.Item, View, Zoomable):
                 bounds = intersect(self.bounds, bounds)
                 width = bounds.x2 - bounds.x1
                 height = bounds.y2 - bounds.y1
-                cr.reset_clip()
+                # cr.reset_clip()
+                cr.restore()
                 cr.rectangle(bounds.x1, bounds.y1, width, height)
                 cr.clip()
 
                 # draw the value label
                 roundedrec(cr, x - KW_LABEL_HPAD2, y - KW_LABEL_VPAD2, 
                     w + KW_LABEL_HPAD, h + KW_LABEL_VPAD, r=10)
+                cr.set_source_rgb(1, 1, 1)
                 cr.fill()
                 cr.set_source_rgb(1, 0, 0)
                 cr.move_to(x, y + h)
                 cr.show_text(text)
+            else:
+                cr.restore()
 
     def make_curve(self, cr):
         if not self.interpolator:



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