- fix: Horizontal scroll with touchpad is not working.

This commit is contained in:
Roy Qu 2023-04-13 20:05:28 +08:00
parent 2532a1dcdb
commit 98989f34c1
2 changed files with 14 additions and 0 deletions

View File

@ -2,6 +2,7 @@ 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.
Red Panda C++ Version 2.20

View File

@ -6326,6 +6326,19 @@ void QSynEdit::wheelEvent(QWheelEvent *event)
mWheelAccumulatedDeltaY+=120;
verticalScrollBar()->setValue(verticalScrollBar()->value()+mMouseWheelScrollSpeed);
}
if ( (mWheelAccumulatedDeltaX>0 &&event->angleDelta().x()<0)
|| (mWheelAccumulatedDeltaX<0 &&event->angleDelta().x()>0))
mWheelAccumulatedDeltaX=0;
mWheelAccumulatedDeltaX+=event->angleDelta().x();
while (mWheelAccumulatedDeltaX>=120) {
mWheelAccumulatedDeltaX-=120;
horizontalScrollBar()->setValue(horizontalScrollBar()->value()-mMouseWheelScrollSpeed);
}
while (mWheelAccumulatedDeltaX<=-120) {
mWheelAccumulatedDeltaX+=120;
horizontalScrollBar()->setValue(horizontalScrollBar()->value()+mMouseWheelScrollSpeed);
}
}
event->accept();
}