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

Method on_ld

imagepy/ui/widgets/cmappanel.py:62–71  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

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]
64 if abs(y-7)>8:return -1
65 self.idx = self.pick(x, y)
66 if self.idx==-1:
67 self.pts.append((x,)+tuple(self.cmap[x]))
68 self.idx = len(self.pts)-1
69 self.cmap[:] = self.linear_color(self.pts)
70 self.update()
71 self.handle()
72
73 def on_lu(self, event):
74 self.idx = -1

Callers

nothing calls this directly

Calls 5

pickMethod · 0.95
linear_colorMethod · 0.95
updateMethod · 0.95
appendMethod · 0.80
handleMethod · 0.45

Tested by

no test coverage detected