Ignore wrong wheel direction in ElasticScroll.
This commit is contained in:
parent
8db6dcf125
commit
b6cb6cb770
1 changed files with 3 additions and 0 deletions
|
|
@ -658,6 +658,9 @@ bool ElasticScroll::handleWheelEvent(not_null<QWheelEvent*> e, bool touch) {
|
||||||
}
|
}
|
||||||
const auto pixels = ScrollDelta(e);
|
const auto pixels = ScrollDelta(e);
|
||||||
auto delta = _vertical ? -pixels.y() : pixels.x();
|
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 (phase == Qt::NoScrollPhase) {
|
||||||
if (_overscroll == currentOverscrollDefault()) {
|
if (_overscroll == currentOverscrollDefault()) {
|
||||||
tryScrollTo(_state.visibleFrom + delta);
|
tryScrollTo(_state.visibleFrom + delta);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue