Browse Source

fix scrolling regression

master
Nils 3 years ago
parent
commit
4715a1f666
  1. 9
      qtgui/playhead.py
  2. 3
      qtgui/scoreview.py

9
qtgui/playhead.py

@ -65,6 +65,7 @@ class Playhead(QtWidgets.QGraphicsLineItem):
#self.hide()
#self.maxHeight = QtWidgets.QDesktopWidget().geometry().height() #we really hope the screen resolution does not change during the session.
def setCursorPosition(self, tickindex:int, playbackStatus:bool):
"""the tickindex to pixel index on the x axis is a fixed 1:n
relation. What you see is where you are. No jumps, the playhead
@ -83,11 +84,9 @@ class Playhead(QtWidgets.QGraphicsLineItem):
#y = self.parentScoreScene.parentView.verticalScrollBar().value()
#self.parentScoreScene.parentView.centerOn(x, y)
#r = self.parentScoreScene.parentView.mapToScene(self.parentScoreScene.parentView.geometry())
#x -=QtCore.QRectF(r.boundingRect()).width()
#self.parentScoreScene.parentView.horizontalScrollBar().setValue(x * constantsAndConfigs.zoomFactor)
self.parentScoreScene.parentView.centerOn(self)
r = self.parentScoreScene.parentView.mapToScene(self.parentScoreScene.parentView.geometry())
x -= QtCore.QRectF(r.boundingRect()).width() / 2
self.parentScoreScene.parentView.horizontalScrollBar().setValue(x * constantsAndConfigs.zoomFactor)
def setRecordingMode(self, state:bool):
if state:

3
qtgui/scoreview.py

@ -183,8 +183,7 @@ class ScoreView(QtWidgets.QGraphicsView):
if update:
self._oldWidth = width
r = self.sceneRect()
r.setWidth(width) #previously we had widht*1.5 here to keep the playback cursor in the middle of the screen.
#however, this does widen exponentially *1.5 which is bad for performance
r.setWidth(width+300) #previously we had widht*1.5 here to keep the playback cursor in the middle of the screen. #however, this does widen exponentially *1.5 which is bad for performance
#and also the screen extends needlesly to the right
self.setSceneRect(r)
self.scoreScene.grid.adjustRhythmLines()

Loading…
Cancel
Save