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

Method on_drag

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

Source from the content-addressed store, hash-verified

203 DraggableItem.setup(self, refWidget, newParent)
204
205 def on_drag(self, emitter, x, y):
206 if self.active:
207 if self.origin_x == -1:
208 self.origin_x = float(x)
209 self.origin_y = float(y)
210 self.refWidget_origin_r = float(self.refWidget.attributes['r'])
211 else:
212 r = self.round_grid(
213 self.refWidget_origin_r + float(x) - self.origin_x)
214 self.refWidget.attributes['r'] = str(max(0, r))
215 self.update_position()
216
217 def update_position(self):
218 if self.refWidget:

Callers

nothing calls this directly

Calls 2

update_positionMethod · 0.95
round_gridMethod · 0.80

Tested by

no test coverage detected