[meld] On textview expose, only redraw chunks within the expose area



commit e9f13de891a5de35bc6eb3e376a75c1d5c317885
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Mon Aug 9 16:56:11 2010 +1000

    On textview expose, only redraw chunks within the expose area

 meld/filediff.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index e657dd4..60571ab 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -934,12 +934,15 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
             return
         visible = textview.get_visible_rect()
         pane = self.textview.index(textview)
-        bounds = (self._pixel_to_line(pane, visible.y),
-                  self._pixel_to_line(pane, visible.y + visible.height + 1))
+        area = event.area
+        x, y = textview.window_to_buffer_coords(gtk.TEXT_WINDOW_WIDGET,
+                                                area.x, area.y)
+        bounds = (self._pixel_to_line(pane, x),
+                  self._pixel_to_line(pane, y + area.height + 1))
 
         width, height = textview.allocation.width, textview.allocation.height
         context = event.window.cairo_create()
-        context.rectangle(0, 0, width, height)
+        context.rectangle(area.x, area.y, area.width, area.height)
         context.clip()
         context.set_line_width(1.0)
 



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