mirror of https://gitlab.com/pamhyr/pamhyr2
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
parent
b503e54210
commit
14e13d6624
|
|
@ -965,9 +965,10 @@ class GraphWidget(QGraphicsView):
|
||||||
self.set_current_edge(edge)
|
self.set_current_edge(edge)
|
||||||
if not locked:
|
if not locked:
|
||||||
if items and type(items[0]) is NodeItem:
|
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]
|
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:
|
if not locked:
|
||||||
# Add nodes and edges
|
# Add nodes and edges
|
||||||
|
|
@ -1022,6 +1023,8 @@ class GraphWidget(QGraphicsView):
|
||||||
self._mouse_origin_y)
|
self._mouse_origin_y)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
# reset the current moved node
|
||||||
|
self._current_moved_node = None
|
||||||
|
|
||||||
self.update()
|
self.update()
|
||||||
super(GraphWidget, self).mouseReleaseEvent(event)
|
super(GraphWidget, self).mouseReleaseEvent(event)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue