Hot fix for reversed scroll direction when dragging input above or below Qt piano roll view.

This commit is contained in:
mjbudd77 2022-01-12 19:46:37 -05:00
parent c075043727
commit 1ca8b8e9d0
1 changed files with 11 additions and 3 deletions

View File

@ -5802,9 +5802,13 @@ void QPianoRoll::periodicUpdate(void)
d = scroll_y / pxLineSpacing; 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; v = maxLineOffset;
} }
@ -5821,12 +5825,16 @@ void QPianoRoll::periodicUpdate(void)
d = scroll_y / pxLineSpacing; d = scroll_y / pxLineSpacing;
v += d; scroll_y = 0; v -= d; scroll_y = 0;
if ( v < 0 ) if ( v < 0 )
{ {
v = 0; v = 0;
} }
else if ( v > maxLineOffset )
{
v = maxLineOffset;
}
vbar->setValue(v); vbar->setValue(v);
} }
} }