diff options
author | Patrick Luby <patrick.luby@collabora.com> | 2023-03-20 16:48:30 -0400 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-03-21 14:23:51 +0000 |
commit | d82a734c07b85cbd7861699b7fa6d3ebbb3122f2 (patch) | |
tree | 70a2b3f36d177f638f299af6258cb4c1d4179057 /sc | |
parent | 28b16870553f436b8dd0f74894896136057402a3 (diff) |
tdf#152406 Disable anti-jitter code for scroll wheel events
After moving thousands of columns to the right via horizontal
scroll wheel or trackpad swipe events, most vertical scroll
wheel or trackpad swipe events will trigger the anti-jitter code
because nScrollPos and nPrevDragPos will be equal and nDelta
will be overriden and set to zero. So, only use the anti-jitter
code for mouse drag events.
Change-Id: I9a22b31e1e012a97a058ab36e040629a71f5d24f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149183
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 66ddcda2d223..9142393a9152 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -1182,16 +1182,28 @@ void ScTabView::ScrollHdl(ScrollAdaptor* pScroll) tools::Long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin; nDelta = nScrollPos - nViewPos; - if ( nScrollPos > nPrevDragPos ) - { - if (nDelta<0) nDelta=0; - } - else if ( nScrollPos < nPrevDragPos ) + + // tdf#152406 Disable anti-jitter code for scroll wheel events + // After moving thousands of columns to the right via + // horizontal scroll wheel or trackpad swipe events, most + // vertical scroll wheel or trackpad swipe events will trigger + // the anti-jitter code because nScrollPos and nPrevDragPos + // will be equal and nDelta will be overriden and set to zero. + // So, only use the anti-jitter code for mouse drag events. + if ( eType == ScrollType::Drag ) { - if (nDelta>0) nDelta=0; + if ( nScrollPos > nPrevDragPos ) + { + if (nDelta<0) nDelta=0; + } + else if ( nScrollPos < nPrevDragPos ) + { + if (nDelta>0) nDelta=0; + } + else + nDelta = 0; } - else - nDelta = 0; + nPrevDragPos = nScrollPos; } break; |