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

Method on_drag

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

Source from the content-addressed store, hash-verified

243 self.style['display'] = 'block'
244
245 def on_drag(self, emitter, x, y):
246 if self.active:
247 if self.origin_x == -1:
248 self.origin_x = float(x)
249 self.origin_y = float(y)
250 self.refWidget_origin_w = gui.from_pix(
251 self.refWidget.style['width'])
252 self.refWidget_origin_h = gui.from_pix(
253 self.refWidget.style['height'])
254 else:
255 self.refWidget.style['width'] = gui.to_pix(self.round_grid(
256 self.refWidget_origin_w + float(x) - self.origin_x))
257 self.refWidget.style['height'] = gui.to_pix(self.round_grid(
258 self.refWidget_origin_h + float(y) - self.origin_y))
259 self.update_position()
260
261 def update_position(self):
262 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