1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 """
20 A representation of the cursor and it's position on in the Timeline window.
21 """
25
27 self._start_pos = (x, y)
28 self._current_pos = (x, y)
29 self._has_moved = False
30
32 return 'Cursor from (%d, %d) at %d, %d' % (self._start_pos[0],
33 self._start_pos[1],
34 self._current_pos[0],
35 self._current_pos[1])
36
37 @property
39 return self._current_pos[0]
40
41 @property
43 return self._current_pos[1]
44
45 @property
47 return self._current_pos
48
49 @property
51 return self._start_pos
52
53 @property
55 x0, y0 = self._start_pos
56 x1, y1 = self._current_pos
57 return (min(x0, x1), min(y0, y1), abs(x1 - x0), abs(y0 - y1))
58
60 return self._has_moved
61
63 self.move(*self._current_pos)
64
65 - def move(self, x, y):
66 self._has_moved = self._current_pos != (x, y)
67 self._current_pos = (x, y)
68