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

Feature: Possibility to turn off feature, when image can be panned when cropped #98

Open
RadoslawGorczyca opened this issue Aug 23, 2024 · 14 comments

Comments

@RadoslawGorczyca
Copy link

RadoslawGorczyca commented Aug 23, 2024

Hi, is it possible to add some kind of a flag allowing us to turn off following feature?

Unlike Image(), ZoomableImage can pan images even when they're cropped. This can be useful for applications like wallpaper apps that may want to use ContentScale.Crop to ensure that images always fill the screen.

Use case is that I have a horizontal pager and I want to allow user to pan cropped picture when the picture is zoomed in, but not when it's completely zoomed out, because when he try to scroll to the next page, image is panned and getting to next picture is allowed only when we pan to the edge of the picture.

I would really appreciate if you added this feature. Thank you in advance.

@saket
Copy link
Owner

saket commented Aug 23, 2024

but not when it's completely zoomed out, because when he try to scroll to the next page, image is panned and getting to next picture is allowed only when we pan to the edge of the picture.

I'm sorry, but I'm a bit confused. If the image is completely zoomed out, it shouldn't be possible to pan it any further, right?

Would it be possible for you to share a video of your use case?

@RadoslawGorczyca
Copy link
Author

You see how I have to scroll picture to the edge to change page? I would like the panning feature available only when the picture is zoomed in. Otherwise I would like to have standard cropped picture with trimmed edges.

Screen.Recording.2024-08-27.at.08.57.30.mov

@MHShetty
Copy link

MHShetty commented Sep 2, 2024

Hi @RadoslawGorczyca,

Could you please share your composable code related to this UI? Maybe that could help us help you out better

@RadoslawGorczyca
Copy link
Author

I cannot share any part of the code other than using your lib, but I don't see how my code would help with anything. It's not an error, but lack of possibility to turn off feature that you added to lib. Other person also mentioned it in his issue.

@RadoslawGorczyca
Copy link
Author

bump

@saket
Copy link
Owner

saket commented Sep 11, 2024

Sorry for the delay, I’ve been dealing with chickenpox. 🤒

@RadoslawGorczyca
Copy link
Author

No worries, I hope you're okay 🤗

@RadoslawGorczyca
Copy link
Author

@saket Is something going to happen with this issue?

@saket
Copy link
Owner

saket commented Dec 4, 2024

I wasn't able to come up with a clean API that'd support this. Do you have suggestions?

@RadoslawGorczyca
Copy link
Author

Well, your own suggestions sounded pretty good in this issue

@saket
Copy link
Owner

saket commented Dec 6, 2024

Will disabling over-zoom help you solve this?

I would like the panning feature available only when the picture is zoomed in.

@RadoslawGorczyca
Copy link
Author

How can I disable over-zoom to check if this helps?

@saket
Copy link
Owner

saket commented Dec 16, 2024

Disabling over-zoom isn't supported at the moment, but I'm also unable to imagine how that'll solve your panning issue mentioned here.

After giving it some thought, I believe there could be a way to prevent panning here when the user zoom is zero. However this feels like a niche usecase, and it's hard to justify investing time in something that 99% people likely wouldn't need. That said, I'm willing to be proved.

@RadoslawGorczyca
Copy link
Author

RadoslawGorczyca commented Jan 22, 2025

@saket I sent you a video, you can see clearly that user cannot swipe between pictures without stopping on every single one to scroll from edge to edge, just to change to next photo. Yo can't tell me that this behaviour is common, I truly believe that there should be a way to turn off this when picture is fully zoomed out. There was another issue on this matter, so I don't know why you're saying that 99% of people wouldn't need this feature.

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

3 participants