Browse Source

Fix canvaspreview out-of-bounds panning for patchbay

Using the small canvaspreview to pan the patchbay resulted in an
exception when panning out of bounds of the window. In this case Carla
tried to create a QPoint with two floats, for which qt has no
constructor. This results in the panning to hang, as the event is
"handled" with an exception.

Casting these two values to int lets qt create the QPoint
and with that properly set the new cursor position, so panning can be
done in all edges again, without having to be precise with the cursor
positioning.

This is probably a left-over from a python2 to python3 migration, as
python did integer divison by default.
tags/v2.5.3
Sebastian Lohff falkTX <falktx@falktx.com> 1 year ago
parent
commit
512b1b3951
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      source/frontend/widgets/canvaspreviewframe.py

+ 1
- 1
source/frontend/widgets/canvaspreviewframe.py View File

@@ -368,7 +368,7 @@ class CanvasPreviewFrame(QFrame):
fixPos = True

if fixPos:
globalPos = self.mapToGlobal(QPoint(self.fInitialX + x, self.fInitialY + y))
globalPos = self.mapToGlobal(QPoint(int(self.fInitialX + x), int(self.fInitialY + y)))
self.cursor().setPos(globalPos)

x = self.fRenderSource.width() * x / self.fInternalWidth


Loading…
Cancel
Save