From 1ca8b8e9d0c401b8a9687b019af30aa088d1c4d2 Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Wed, 12 Jan 2022 19:46:37 -0500 Subject: [PATCH] Hot fix for reversed scroll direction when dragging input above or below Qt piano roll view. --- src/drivers/Qt/TasEditor/TasEditorWindow.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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); } }