comparison tools/area_editor.py @ 157:76049c9e3d5c

Scroll wheel
author Stefano Rivera <stefano@rivera.za.net>
date Mon, 02 Sep 2013 23:53:11 +0200
parents 6c5f1a78db75
children dba8bc454a43
comparison
equal deleted inserted replaced
156:94a2456696af 157:76049c9e3d5c
222 self.mouse_pos = ev.pos 222 self.mouse_pos = ev.pos
223 if self.cur_poly and old_pos != self.mouse_pos: 223 if self.cur_poly and old_pos != self.mouse_pos:
224 self.invalidate() 224 self.invalidate()
225 225
226 def mouse_down(self, ev): 226 def mouse_down(self, ev):
227 if self.cur_poly: 227 if ev.button == 4: # Scroll up
228 self._move_view((0, -10))
229 elif ev.button == 5: # Scroll down
230 self._move_view((0, 10))
231 elif ev.button == 6: # Scroll left
232 self._move_view((-10, 0))
233 elif ev.button == 7: # Scroll right
234 self._move_view((10, 0))
235 elif self.cur_poly:
228 # Add a point 236 # Add a point
229 self.level.add_point(self.cur_poly, 237 self.level.add_point(self.cur_poly,
230 self._level_coordinates(ev.pos)) 238 self._level_coordinates(ev.pos))
231 239
232 def close_poly(self): 240 def close_poly(self):