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

Scale / Pan Improvement Ideas #92

Open
JacobJaffe opened this issue Jan 10, 2025 · 1 comment
Open

Scale / Pan Improvement Ideas #92

JacobJaffe opened this issue Jan 10, 2025 · 1 comment

Comments

@JacobJaffe
Copy link

JacobJaffe commented Jan 10, 2025

Hello! First off, this library is amazing. Thank you!

In mirroring native behavior on iOS, I'd like to have panning lock horizontally / vertically when zoomed in, if the zoom still fully shows the image fully on the reverse axis. For example, when zooming in on a portrait image, I'd like to prevent vertical panning until the image exceeds the container (screen).

This kinda occurs in this library, but only when not zoomed in. (like for swipe-down behavior).

In a similar vein, it would be really cool if double-tapping could automatically zoom to constrain the image fully in the cross-dimension (maybe only if the image is within a reasonable aspect ratio). This would mirror native behavior as well, and probably under-the-hood use the same kinda calculations to determine if the image is locked-in-frame on a single dimension.

I'm happy to take a stab at implementing this if this sounds reasonable.

@JacobJaffe
Copy link
Author

JacobJaffe commented Jan 10, 2025

Here's an example of what I mean.
See how in the native photos app, scrolling is locked horizontally while the entire height of the image is already in frame. Very smooth!

pan-example-420p.mov

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

No branches or pull requests

1 participant