diff --git a/src/View/Network/GraphWidget.py b/src/View/Network/GraphWidget.py index 6d6daa4c..46a1ff97 100644 --- a/src/View/Network/GraphWidget.py +++ b/src/View/Network/GraphWidget.py @@ -954,9 +954,10 @@ class GraphWidget(QGraphicsView): self.set_current_edge(edge) if not locked: if items and type(items[0]) is NodeItem: - self._mouse_origin_x = pos.x() - self._mouse_origin_y = pos.y() self._current_moved_node = items[0] + node_pos = self._current_moved_node.pos() + self._mouse_origin_x = node_pos.x() + self._mouse_origin_y = node_pos.y() if not locked: # Add nodes and edges @@ -1011,6 +1012,8 @@ class GraphWidget(QGraphicsView): self._mouse_origin_y) ) ) + # reset the current moved node + self._current_moved_node = None self.update() super(GraphWidget, self).mouseReleaseEvent(event)