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

Method on_mv

imagepy/ui/widgets/viewport.py:61–68  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

59 self.drag = False
60
61 def on_mv(self, event):
62 if not self.drag:return
63 x, y = event.GetX(), event.GetY()
64 x = 1.0*(x-self.offx)/self.imgw
65 y = 1.0*(y-self.offy)/self.imgh
66 if x<0 or x>1 or y<0 or y>1:return
67 self.loc = (x*self.ibox[0], y*self.ibox[1])
68 self.handle()
69
70 def GetValue(self):return self.loc
71

Callers

nothing calls this directly

Calls 1

handleMethod · 0.95

Tested by

no test coverage detected