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

Method on_drag

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

Source from the content-addressed store, hash-verified

164 DraggableItem.setup(self, refWidget, newParent)
165
166 def on_drag(self, emitter, x, y):
167 if self.active:
168 if self.origin_x == -1:
169 self.origin_x = float(x)
170 self.origin_y = float(y)
171 self.refWidget_origin_w = float(
172 self.refWidget.attributes['width'])
173 self.refWidget_origin_h = float(
174 self.refWidget.attributes['height'])
175 else:
176 self.refWidget.attributes['width'] = self.round_grid(
177 self.refWidget_origin_w + float(x) - self.origin_x)
178 self.refWidget.attributes['height'] = self.round_grid(
179 self.refWidget_origin_h + float(y) - self.origin_y)
180 self.update_position()
181
182 def update_position(self):
183 if self.refWidget:

Callers

nothing calls this directly

Calls 2

update_positionMethod · 0.95
round_gridMethod · 0.80

Tested by

no test coverage detected