pavelbabenko / react-native-awesome-gallery

Performant, native-like, and well-customizable gallery for React Native.
MIT License
491 stars 54 forks source link

Buggy behavior while changing from portrait to landscape on zoomed in images #44

Closed mtflud closed 2 years ago

mtflud commented 2 years ago

While this is kind of hard to reproduce, it does happen. Looks like the library is having issues displaying an image after toggling between portrait and landscape while zoomed in. These are the reproduction steps that work consistently for me:

https://user-images.githubusercontent.com/2406654/174413776-90c32500-6054-46ca-8dc1-65bc165dc1bd.mov

Any help would be greatly appreciated!

pavelbabenko commented 2 years ago

@mtflud Try calling galleryRef.current?.reset() on toggling between portrait and landscape

mtflud commented 2 years ago

@pavelbabenko Calling reset() works! Thanks for the suggestion. I don't think it's fixing the root cause though, do you think it makes sense to keep this open? I'll give it a shot and send a PR if I find a fix.

pavelbabenko commented 2 years ago

@mtflud It’s too hard to save a right position with orientation change. I checked how native apps work and they reset scale too. So, I think the issue can be closed. Reset function has a boolean parameter, which can animate resetting. Maybe it’ll make the orientation change smoother

danielnedefo commented 4 months ago

@mtflud hi dude,how you achieve this smoothly image resize on orientation change?