Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Fix scrolling and bounds clamping #54

Open
wants to merge 4 commits into
base: release-0.3
Choose a base branch
from

Conversation

sapoturge
Copy link
Owner

Previously, the viewport would prevent scrolling inside the top left corner of the image, preventing viewing the bottom or right sides. This is backwards, and this update fixes it so scrolling is allowed anywhere inside the image, and panning beyond the borders can be done at any time. It also ensures that at least the top left corner is aligned to the pixel grid, ensuring a proper view when fully zoomed out.

This makes it aligned at all scales when using a scroll wheel to zoom; on trackpad, it only
really works when fully zoomed out.
Gtk Scrolled Windows have a kinetic scroll controller that always
updates the adjustments when the scroll stops, which for some reason
snaps the viewport to the top left. I couldn't figure out how to
stop the events from triggering, so I just ignored updates from external
sources for a second after zooming, which acheives the intended effect.
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