MCPcopy Index your code
hub / github.com/rawpython/remi / on_drag

Method on_drag

editor/editor.py:292–306  ·  view source on GitHub ↗
(self, emitter, x, y)

Source from the content-addressed store, hash-verified

290 self.style['display'] = 'block'
291
292 def on_drag(self, emitter, x, y):
293 if self.active:
294 if self.origin_x == -1:
295 self.origin_x = float(x)
296 self.origin_y = float(y)
297 self.refWidget_origin_x = gui.from_pix(
298 self.refWidget.style['left'])
299 self.refWidget_origin_y = gui.from_pix(
300 self.refWidget.style['top'])
301 else:
302 self.refWidget.style['left'] = gui.to_pix(self.round_grid(
303 self.refWidget_origin_x + float(x) - self.origin_x))
304 self.refWidget.style['top'] = gui.to_pix(self.round_grid(
305 self.refWidget_origin_y + float(y) - self.origin_y))
306 self.update_position()
307
308 def update_position(self):
309 self.style['position'] = 'absolute'

Callers

nothing calls this directly

Calls 2

update_positionMethod · 0.95
round_gridMethod · 0.80

Tested by

no test coverage detected