[meld] diffmap: Fix offset calculations when clicking on map
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] diffmap: Fix offset calculations when clicking on map
- Date: Sat, 12 Dec 2015 22:03:07 +0000 (UTC)
commit 7f557fd9d21a884464711e921c0cdea556f971ac
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Dec 13 08:02:17 2015 +1000
diffmap: Fix offset calculations when clicking on map
meld/diffmap.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/meld/diffmap.py b/meld/diffmap.py
index c35e108..b767cf9 100644
--- a/meld/diffmap.py
+++ b/meld/diffmap.py
@@ -168,9 +168,9 @@ class DiffMap(Gtk.DrawingArea):
def do_button_press_event(self, event):
if event.button == 1:
- y_start = self.get_allocation().y - self._scroll_y - self._y_offset
+ y_start = self._scroll_y + self._y_offset
total_height = self._scroll_height - self._h_offset
- fraction = (event.y + y_start) / total_height
+ fraction = (event.y - y_start) / total_height
adj = self._scrolladj
val = fraction * adj.get_upper() - adj.get_page_size() / 2
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]