Scenario: Graph: Fix mouse button event.

scenarios
Pierre-Antoine 2025-09-02 10:53:50 +02:00
parent 4bf0ad40b1
commit e5b4c998cb
1 changed files with 4 additions and 2 deletions

View File

@ -357,8 +357,10 @@ class GraphWidget(QGraphicsView):
if len(selectable_items) == 0:
if event.buttons() & Qt.LeftButton:
old_p = self.mapToScene(
float(self.m_origin_x),
float(self.m_origin_y)
QPoint(
int(self.m_origin_x),
int(self.m_origin_y)
)
)
new_p = self.mapToScene(event.pos())
translation = new_p - old_p