sc/source/ui/view/tabview.cxx | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-)
New commits: commit ea0e721246222c3d470c07d429137f0634592833 Author: Patrick Luby <patrick.l...@collabora.com> AuthorDate: Mon Mar 20 16:48:30 2023 -0400 Commit: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> CommitDate: Wed Mar 22 15:58:45 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/+/149239 Reviewed-by: Patrick Luby <plub...@neooffice.org> Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> 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;