Fix scrolling in wrong direction when using mouse wheel in filebrowser, #5036

This commit is contained in:
heckflosse 2018-11-27 19:54:26 +01:00
parent 6ba989ef1c
commit d06e26356b

View File

@ -76,6 +76,10 @@ void ThumbBrowserBase::scroll (int direction, double deltaX, double deltaY)
} else {
delta = deltaY;
}
if (direction == GDK_SCROLL_SMOOTH && delta == 0.0) {
// sometimes this case happens. To avoid scrolling the wrong direction in this case, we just do nothing
return;
}
double coef = direction == GDK_SCROLL_DOWN || (direction == GDK_SCROLL_SMOOTH && delta > 0.0) ? +1.0 : -1.0;
// GUI already acquired when here