summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-27 23:55:35 +0100
committerhut <hut@lavabit.com>2009-12-27 23:55:35 +0100
commit8d0d8f9272b9ceef6b27d35580472b9c86dff681 (patch)
treeea0e08452cc7d49fb9a2f9acf2839c7ab30a4da6
parenta666f32b959416d062ac38645dc27f20686d881b (diff)
downloadranger-8d0d8f9272b9ceef6b27d35580472b9c86dff681.tar.gz
fixed mouse-event with negative coordinates
-rw-r--r--ranger/gui/mouse_event.py8
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"""
ref='/danisanti/profani-tty/blame/tests/test_muc.c?id=63b3299b069a276994508859e4a8b6500f47df2e'>^
d25d6b45 ^

a472ce65 ^
d25d6b45 ^
a472ce65 ^


31321077 ^
d25d6b45 ^
31321077 ^
d25d6b45 ^
31321077 ^



d25d6b45 ^
31321077 ^
d25d6b45 ^




31321077 ^
d25d6b45 ^
31321077 ^


23842e52 ^


b177250f ^
23842e52 ^
d25d6b45 ^
23842e52 ^

23842e52 ^

d25d6b45 ^
23842e52 ^
b177250f ^

d25d6b45 ^
23842e52 ^
d25d6b45 ^
23842e52 ^

23842e52 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78