[meld] Fix linkmap click detection when scrollbar is offset in auto-merge



commit 26614cbcc3e77bd758d581fdbeab907b1d4bfde2
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Mar 7 15:54:29 2010 +1000

    Fix linkmap click detection when scrollbar is offset in auto-merge
    
    This is the second part of commit #3aabcd, and fixes behaviour with
    InfoBars in auto-merge mode.

 meld/filemerge.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/meld/filemerge.py b/meld/filemerge.py
index f6ef329..87349dc 100644
--- a/meld/filemerge.py
+++ b/meld/filemerge.py
@@ -113,15 +113,19 @@ class FileMerge(filediff.FileDiff):
         dst = 1
         srcadj = self.scrolledwindow[src].get_vadjustment()
         dstadj = self.scrolledwindow[dst].get_vadjustment()
+        yoffset = self.linkmap[which].allocation.y
+        dst_offset = self.textview[dst].allocation.y - yoffset
+        src_offset = self.textview[src].allocation.y - yoffset
+
         for c in self.linediffer.pair_changes(src, dst):
             if c[0] == "insert":
                 if origsrc != 1:
                     continue
-                h = self._line_to_pixel(dst, c[3]) - dstadj.value
+                h = self._line_to_pixel(dst, c[3]) - dstadj.value + dst_offset
             else:
                 if origsrc == 1:
                     continue
-                h = self._line_to_pixel(src, c[1]) - srcadj.value
+                h = self._line_to_pixel(src, c[1]) - srcadj.value + src_offset
             if h < 0: # find first visible chunk
                 continue
             elif h > htotal: # we've gone past last visible



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