diff options
author | hut <hut@lavabit.com> | 2009-12-27 23:55:35 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2009-12-27 23:55:35 +0100 |
commit | 8d0d8f9272b9ceef6b27d35580472b9c86dff681 (patch) | |
tree | ea0e08452cc7d49fb9a2f9acf2839c7ab30a4da6 /ranger | |
parent | a666f32b959416d062ac38645dc27f20686d881b (diff) | |
download | ranger-8d0d8f9272b9ceef6b27d35580472b9c86dff681.tar.gz |
fixed mouse-event with negative coordinates
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/gui/mouse_event.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ranger/gui/mouse_event.py b/ranger/gui/mouse_event.py index db98e1aa..c165ffa3 100644 --- a/ranger/gui/mouse_event.py +++ b/ranger/gui/mouse_event.py @@ -9,6 +9,14 @@ class MouseEvent(object): def __init__(self, getmouse): """Creates a MouseEvent object from the result of win.getmouse()""" _, self.x, self.y, _, self.bstate = getmouse + + # x-values above ~220 suddenly became negative, apparently + # it's sufficient to add 0xFF to fix that error. + if self.x < 0: + self.x += 0xFF + + if self.y < 0: + self.y += 0xFF def pressed(self, n): """Returns whether the mouse key n is pressed""" |