MCPcopy Create free account
hub / github.com/Image-Py/imagepy / mouse_move

Method mouse_move

imagepy/tools/Transform/rotate_tol.py:22–39  ·  view source on GitHub ↗
(self, ips, x, y, btn, **key)

Source from the content-addressed store, hash-verified

20 else : self.plg.preview(ips, self.para)
21
22 def mouse_move(self, ips, x, y, btn, **key):
23 lim = 5.0/key['canvas'].get_scale()
24 if btn==None:
25 self.cursor = wx.CURSOR_CROSS
26 if abs(x-self.para['ox'])<lim and abs(y-self.para['oy']<lim):
27 self.cursor = wx.CURSOR_HAND
28 elif self.moving:
29 self.para['ox'], self.para['oy'] = x, y
30 self.plg.dialog.reset()
31 ips.update()
32 else:
33 dx, dy = x-self.para['ox'], y-self.para['oy']
34 ang = np.arccos(dx/np.sqrt(dx**2+dy**2))
35 if dy<0: ang = np.pi*2-ang
36 ang = int(ang/np.pi*180)
37 self.para['ang'] = ang
38 self.plg.dialog.reset()
39 ips.update()
40
41class Plugin(Filter):
42 """RotateTool class plugin derived from imagepy.core.engine.Filter"""

Callers

nothing calls this directly

Calls 3

get_scaleMethod · 0.80
resetMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected