sc/source/ui/view/tabview.cxx | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-)
New commits: commit 12fdd2792c392a5b355110836faa40db5866e57e Author: Patrick Luby <patrick.l...@collabora.com> AuthorDate: Mon Mar 20 16:48:30 2023 -0400 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Mar 21 20:21:47 2023 +0000 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 <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit d82a734c07b85cbd7861699b7fa6d3ebbb3122f2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149238 diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 17a414a5f5e4..aad41a9c1236 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;