From ba218fb8b8811d7a5ddcf3f21d49b72269983d6e Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 13 Apr 2023 21:50:53 +0800 Subject: [PATCH] - fix: Horizontal scroll by touchpad is inversed. --- NEWS.md | 3 ++- libs/qsynedit/qsynedit/qsynedit.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 4ae894a0..d6f8b1c7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,8 @@ Red Panda C++ Version 2.21 - change: The option "Check for stack smashing attacks (-fstack-protector)" is turned off by default in the Debug compiler set settings. - fix: Project makefile generated for C files is not correct. - - fix: Horizontal scroll with touchpad is not working. + - fix: Horizontal scroll by touchpad is not working. + - fix: Horizontal scroll by touchpad is inversed. Red Panda C++ Version 2.20 diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index 2e5fb09a..bde4a5b6 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -6307,11 +6307,11 @@ void QSynEdit::wheelEvent(QWheelEvent *event) mWheelAccumulatedDeltaX+=event->angleDelta().y(); while (mWheelAccumulatedDeltaX>=120) { mWheelAccumulatedDeltaX-=120; - horizontalScrollBar()->setValue(horizontalScrollBar()->value()-mMouseWheelScrollSpeed); + horizontalScrollBar()->setValue(horizontalScrollBar()->value()+mMouseWheelScrollSpeed); } while (mWheelAccumulatedDeltaX<=-120) { mWheelAccumulatedDeltaX+=120; - horizontalScrollBar()->setValue(horizontalScrollBar()->value()+mMouseWheelScrollSpeed); + horizontalScrollBar()->setValue(horizontalScrollBar()->value()-mMouseWheelScrollSpeed); } } else { if ( (mWheelAccumulatedDeltaY>0 &&event->angleDelta().y()<0) @@ -6333,11 +6333,11 @@ void QSynEdit::wheelEvent(QWheelEvent *event) mWheelAccumulatedDeltaX+=event->angleDelta().x(); while (mWheelAccumulatedDeltaX>=120) { mWheelAccumulatedDeltaX-=120; - horizontalScrollBar()->setValue(horizontalScrollBar()->value()-mMouseWheelScrollSpeed); + horizontalScrollBar()->setValue(horizontalScrollBar()->value()+mMouseWheelScrollSpeed); } while (mWheelAccumulatedDeltaX<=-120) { mWheelAccumulatedDeltaX+=120; - horizontalScrollBar()->setValue(horizontalScrollBar()->value()+mMouseWheelScrollSpeed); + horizontalScrollBar()->setValue(horizontalScrollBar()->value()-mMouseWheelScrollSpeed); } } event->accept();