Fix scrolling with a touchpad in vertical drum.

This commit is contained in:
John Preston 2022-04-01 16:24:19 +04:00
parent 9478798a47
commit 7b7016c4b3

View file

@ -106,8 +106,10 @@ void VerticalDrumPicker::handleWheelEvent(not_null<QWheelEvent*> e) {
if (direction) { if (direction) {
_animation.jumpToOffset(direction); _animation.jumpToOffset(direction);
} else { } else {
increaseShift( const auto delta = e->pixelDelta().y()
std::min(e->pixelDelta().y() / float64(_itemHeight), 0.99)); ? e->pixelDelta().y()
: e->angleDelta().y();
increaseShift(std::min(delta / float64(_itemHeight), 0.99));
if (e->phase() == Qt::ScrollEnd) { if (e->phase() == Qt::ScrollEnd) {
animationDataFromIndex(); animationDataFromIndex();
_animation.jumpToOffset(0); _animation.jumpToOffset(0);