saket / telephoto

Building blocks for designing media experiences in Compose UI
https://saket.github.io/telephoto/
Apache License 2.0
1k stars 33 forks source link

maxZoomFactor should apply on top of any zoom applied by the content scale #45

Open MV-GH opened 1 year ago

MV-GH commented 1 year ago

Something that I have noticed is that zoomlevel seems very inconsistent. Sometimes I can barely zoom at all.

https://github.com/saket/telephoto/assets/67873169/38d91501-2883-4abc-8741-6c18a8134b36

For now I have countered this by doing 20x.

see repro: https://github.com/MV-GH/ReproChannelCrash/tree/bug/inconsisent_zoom

saket commented 1 year ago

I can see why this can be confusing, but the explanation is that that image is already max zoomed in to fit its bounds. This can be verified by changing the contentScale to ContentScale.Inside:

https://github.com/saket/telephoto/assets/2387680/d14b5ce7-c71e-433a-86df-0e8c3ef317a4

MV-GH commented 1 year ago

I see, from a technical perspective this indeed correct. But from a user perspective it does feel like one image can be zoomed in more than others. Which was the feedback i was getting. Maybe a option where it starts the zoomlevel from the size it takes up? It is not really needed for me as the users just wanted a "limitless" zoom. So I have set to a rather big number. You can close this if you want.

saket commented 1 year ago

Agree, I'll think more about this.

It is not really needed for me as the users just wanted a "limitless" zoom. So I have set to a rather big number.

This unfortunately has a downside that double tapping images in your app will zoom them all the way to 20x.

MV-GH commented 1 year ago

I see, #32 could help with that

FooIbar commented 4 months ago

Yeah, we would like to have something like maxUserZoom instead of the current maxZoomFactor.