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

Method mouse_down

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

Source from the content-addressed store, hash-verified

15 self.odx, self.ody = 0, 0
16
17 def mouse_down(self, ips, x, y, btn, **key):
18 lim = 5.0/key['canvas'].get_scale()
19 if btn==1:
20 if ips.roi!=None:
21 self.curobj = ips.roi.pick(x, y, ips.cur, lim)
22 ips.roi.info(ips, self.curobj)
23 if self.curobj!=None:return
24 if not isinstance(ips.roi, pointroi.PointRoi):
25 ips.roi = pointroi.PointRoi()
26 if not key['shift']:del ips.roi.body[:]
27 ips.roi.add((x,y,ips.cur))
28 self.curobj = ips.roi.pick(x, y, ips.cur, lim)
29 ips.update()
30 self.odx, self.ody = x, y
31
32 def mouse_up(self, ips, x, y, btn, **key):
33 self.curobj = None

Callers

nothing calls this directly

Calls 5

get_scaleMethod · 0.80
pickMethod · 0.45
infoMethod · 0.45
addMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected