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

Method on_mv

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

Source from the content-addressed store, hash-verified

102
103
104 def on_mv(self, event):
105 x,y = event.GetX()-self.offset[0], event.GetY()-self.offset[1]
106 if self.pick(x, y)!=-1:
107 self.SetCursor(wx.Cursor(wx.CURSOR_HAND))
108 else: self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
109 if self.idx!=-1:
110 oldx = self.pts[self.idx][0]
111 if oldx == 0: x=0
112 elif oldx==255: x=255
113 else: x = np.clip(x, 1, 254)
114 cl = self.pts[self.idx][1:]
115 self.pts[self.idx] = (x,)+cl
116 self.cmap[:] = self.linear_color(self.pts)
117 self.update()
118 self.handle()
119
120
121 def on_paint(self, event):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected