diff --git a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp index 930e28cf..2e4303db 100644 --- a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp +++ b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp @@ -5802,9 +5802,13 @@ void QPianoRoll::periodicUpdate(void) d = scroll_y / pxLineSpacing; - v += d; scroll_y = 0; + v -= d; scroll_y = 0; - if ( v > maxLineOffset ) + if ( v < 0 ) + { + v = 0; + } + else if ( v > maxLineOffset ) { v = maxLineOffset; } @@ -5821,12 +5825,16 @@ void QPianoRoll::periodicUpdate(void) d = scroll_y / pxLineSpacing; - v += d; scroll_y = 0; + v -= d; scroll_y = 0; if ( v < 0 ) { v = 0; } + else if ( v > maxLineOffset ) + { + v = maxLineOffset; + } vbar->setValue(v); } }