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

Method pick

imagepy/ui/widgets/cmappanel.py:56–60  ·  view source on GitHub ↗
(self, x, y)

Source from the content-addressed store, hash-verified

54 self.dirty = False
55
56 def pick(self, x, y):
57 if abs(y-10)>3:return -1
58 dis = np.abs(np.array(self.pts)[:,0]-x)
59 if dis.min() > 3: return -1
60 return np.argmin(dis)
61
62 def on_ld(self, event):
63 x,y = event.GetX()-self.offset[0], event.GetY()-self.offset[1]

Callers 4

on_ldMethod · 0.95
on_rdMethod · 0.95
on_rdcMethod · 0.95
on_mvMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected