Network: Fix potential crash with maptoscene.

setup.py
Pierre-Antoine Rouby 2024-04-22 11:05:14 +02:00
parent df1ac5586e
commit ffdeb28bfd
1 changed files with 4 additions and 2 deletions

View File

@ -819,8 +819,10 @@ class GraphWidget(QGraphicsView):
if self._state == "move":
# Move on scene
if (not self.selected_item() and
event.buttons() & Qt.LeftButton):
old_p = self.mapToScene(self.m_origin_x, self.m_origin_y)
(event.buttons() & Qt.LeftButton)):
old_p = self.mapToScene(
int(self.m_origin_x), int(self.m_origin_y)
)
new_p = self.mapToScene(event.pos())
translation = new_p - old_p