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

Method mouse_move

imagepy/tools/Standard/rectangle_tol.py:68–81  ·  view source on GitHub ↗
(self, ips, x, y, btn, **key)

Source from the content-addressed store, hash-verified

66 ips.update()
67
68 def mouse_move(self, ips, x, y, btn, **key):
69 if ips.roi==None:return
70 lim = 5.0/key['canvas'].get_scale()
71 if btn==None:
72 self.cursor = wx.CURSOR_CROSS
73 if ips.roi.snap(x, y, ips.cur, lim)!=None:
74 self.cursor = wx.CURSOR_HAND
75 elif btn==1:
76 if ips.roi.dtype == 'polygon' and self.doing:
77 l,b,r,t = self.ox, self.oy, x, y
78 self.helper.buf = [[(l,b),(r,b),(r,t),(l,t),(l,b)],[]]
79 if self.curobj: ips.roi.draged(self.odx, self.ody, x, y, ips.cur, self.curobj)
80 ips.update()
81 self.odx, self.ody = x, y
82
83 def mouse_wheel(self, ips, x, y, d, **key):
84 pass

Callers

nothing calls this directly

Calls 4

get_scaleMethod · 0.80
snapMethod · 0.45
dragedMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected