From b6cb6cb770236a49bffdf572427faa477f00ccc0 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 12 Jul 2023 23:01:19 +0400 Subject: [PATCH] Ignore wrong wheel direction in ElasticScroll. --- ui/widgets/elastic_scroll.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/widgets/elastic_scroll.cpp b/ui/widgets/elastic_scroll.cpp index 2615d20..4ae5bd9 100644 --- a/ui/widgets/elastic_scroll.cpp +++ b/ui/widgets/elastic_scroll.cpp @@ -658,6 +658,9 @@ bool ElasticScroll::handleWheelEvent(not_null e, bool touch) { } const auto pixels = ScrollDelta(e); auto delta = _vertical ? -pixels.y() : pixels.x(); + if (std::abs(_vertical ? pixels.x() : pixels.y()) >= std::abs(delta)) { + delta = 0; + } if (phase == Qt::NoScrollPhase) { if (_overscroll == currentOverscrollDefault()) { tryScrollTo(_state.visibleFrom + delta);