Skip to content

Add smooth scroll support in GthImageViewer#247

Open
darkowlzz wants to merge 1 commit intolinuxmint:masterfrom
darkowlzz:browser-viewer-smooth-scroll
Open

Add smooth scroll support in GthImageViewer#247
darkowlzz wants to merge 1 commit intolinuxmint:masterfrom
darkowlzz:browser-viewer-smooth-scroll

Conversation

@darkowlzz
Copy link

@darkowlzz darkowlzz commented Mar 23, 2026

Enabling smooth scroll support in image viewer allows touch pad (on laptops) to zoom-in/zoom-out and change image without a mouse with a wheel.

The zoom and image change scenarios are handled differently. Since smooth/non-discrete change in zoom level is preferable, the scroll delta is directly used to change the zoom level. But in case of image change, directly applying even a tiny scroll delta change +/- can result in quick and large jump in image change. A small threshold is introduced to reject tiny scroll delta which may result in unintended image change. This still allows large jumps in image change using scroll above the threshold.

I'm not sure if the scroll delta threshold for image change is the best we can do. I'm open for any suggestions.

Enabling smooth scroll support in image viewer allows touch pad (on
laptops) to zoom-in/zoom-out and change image without a mouse with
a wheel.

The zoom and image change scenarios are handled differently. Since
smooth/non-discrete change in zoom level is preferable, the scroll delta
is directly used to change the zoom level. But in case of image change,
directly applying even a tiny scroll delta change +/- can result in
quick and large jump in image change. A small threshold is introduced to
reject tiny scroll delta which may result in unintended image change.
This still allows large jumps in image change using scroll above the
threshold.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant