From 14e13d66246f86027f5d0cfb5de1235ebf515b8d Mon Sep 17 00:00:00 2001 From: Dylan Jeannin Date: Mon, 31 Aug 2026 11:56:01 +0200 Subject: [PATCH] Moving points in network: selected node is now unselected after the end of moving, so clicking anywhere in the graph doesnt change his position anymore without refreshing the window --- src/View/Network/GraphWidget.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/View/Network/GraphWidget.py b/src/View/Network/GraphWidget.py index 31b0fcdd..263ab957 100644 --- a/src/View/Network/GraphWidget.py +++ b/src/View/Network/GraphWidget.py @@ -965,9 +965,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 @@ -1022,6 +1023,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)