-
Notifications
You must be signed in to change notification settings - Fork 103
Open
Description
If you have smooth scrolling enabled (the "Disable scroll animations" option unchecked) and try to scroll through an image using a Mac trackpad, the image fights back. It feels like it wants to snap back to where it was instead of following the gesture.
Disabling smooth scrolling fixes it, but that's not ideal.
The trackpad handler (wheelEventTrackpad) applies scroll deltas directly to the scrollbar, but it doesn't check if there's already a scroll animation running. So you end up with the animation trying to move the scrollbar one way while your trackpad input tries to move it another way. They fight each other.
Maybe just stop any running animations before applying the trackpad input?
void Viewer::wheelEventTrackpad(QWheelEvent *event)
{
auto delta = event->pixelDelta();
// Stop any running scroll animations to prevent conflict with trackpad input
if (verticalScroller->state() == QAbstractAnimation::Running) {
verticalScroller->stop();
}
if (horizontalScroller->state() == QAbstractAnimation::Running) {
horizontalScroller->stop();
}
// ... rest unchanged
YACReader/viewer.cpp
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels