Browse Source

Fix type error in signal emission

The `CanvasBox.positionChanged` signal expects to receive `x` and `y` as
`int`s, but they were being passed as `float`s, which mangled them on
the receiving signal handler.

This manifested as huge `x` and `y` values for canvas boxes, and when
saving and loading projects all boxes would hit the edge of the canvas
and get placed at the extreme edge.
pull/1554/head
Stefans Mezulis 2 years ago
parent
commit
50b94ba4e5
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      source/frontend/patchcanvas/canvasbox.py

+ 1
- 1
source/frontend/patchcanvas/canvasbox.py View File

@@ -411,7 +411,7 @@ class CanvasBox(QGraphicsObject):
connection.widget.setZValue(z_value)

def triggerSignalPositionChanged(self):
self.positionChanged.emit(self.m_group_id, self.m_split, self.x(), self.y())
self.positionChanged.emit(self.m_group_id, self.m_split, int(self.x()), int(self.y()))
self.m_will_signal_pos_change = False

@pyqtSlot()


Loading…
Cancel
Save