mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Network: Fix potential crash with maptoscene.
This commit is contained in:
1 parent
df1ac5586e
commit
ffdeb28bfd
1 file changed
+4
-2
@@ -819,8 +819,10 @@ class GraphWidget(QGraphicsView):
|
|||||||
if self._state == "move":
|
if self._state == "move":
|
||||||
# Move on scene
|
# Move on scene
|
||||||
if (not self.selected_item() and
|
if (not self.selected_item() and
|
||||||
event.buttons() & Qt.LeftButton):
|
(event.buttons() & Qt.LeftButton)):
|
||||||
old_p = self.mapToScene(self.m_origin_x, self.m_origin_y)
|
old_p = self.mapToScene(
|
||||||
|
int(self.m_origin_x), int(self.m_origin_y)
|
||||||
|
)
|
||||||
new_p = self.mapToScene(event.pos())
|
new_p = self.mapToScene(event.pos())
|
||||||
translation = new_p - old_p
|
translation = new_p - old_p
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user