def on_mouse_motion(self, x, y, dx, dy):
     self.try_redraw()
     lastx, lasty = x-dx, y-dy
     if x > graphics.canvas_x and y > graphics.canvas_y:
         if not (lastx > graphics.canvas_x and lasty > graphics.canvas_y) \
                 and self.current_tool.cursor != None:
             graphics.main_window.set_mouse_cursor(self.current_tool.cursor)
     else:
         if (lastx > graphics.canvas_x and lasty > graphics.canvas_y) \
                 or (lastx > graphics.width) or (lasty > graphics.height):
             graphics.set_cursor(graphics.cursor['CURSOR_DEFAULT'])
示例#2
0
 def on_mouse_motion(self, x, y, dx, dy):
     if not self.activated or self.keys[key.SPACE]: return
     lastx, lasty = x-dx, y-dy
     if x > graphics.canvas_x and y > graphics.canvas_y:
         if not (lastx > graphics.canvas_x and lasty > graphics.canvas_y) \
                 and self.current_tool.cursor != None:
             graphics.main_window.set_mouse_cursor(self.current_tool.cursor)
     else:
         if (lastx > graphics.canvas_x and lasty > graphics.canvas_y) \
                 or (lastx > graphics.width) or (lasty > graphics.height):
             graphics.set_cursor(graphics.cursor['CURSOR_DEFAULT'])