Closed yfunk closed 3 years ago
Facing a similar issue. The scaled image snaps back to the vertical centre.
react-native-awesome-gallery:
0.3.5
<Gallery
loop={true}
emptySpaceWidth={0}
style={{
top: -57,
position: 'absolute',
}}
onIndexChange={index => {
setCurrentPage(index)
}}
ref={galleryRef}
data={[...links]}
renderItem={({ item }) => {
return (
<Pressable key={item.docID}>
<Image
...
/>
</Pressable>
)
}}
keyExtractor={(_item, index) => `${index}`}
/>
@pavelbabenko Is this still an issue? I notice that when I zoom a lot it recenters the image, instead of staying in the place i stopped the gesture
Description
When performing any gesture to change the image scale, the image seems to always center itself horizontally after the gesture has ended. This is fine when scaling the image to be smaller than the container (
scale < 1
), but should not be happening when zooming in (scale > 1
).Right now this causes the "focus" to shift away from the point that was zoomed into after ending the gesture. For me this issue is happening on Android using the package versions listed below, I was not yet able to test it on an iOS device.
https://user-images.githubusercontent.com/14955991/115701179-cf4fbb00-a367-11eb-938d-95cc112d5ba5.mp4
Minimal code example
Package versions
react-native
: 0.64.0react-native-gesture-handler
: 1.10.3react-native-reanimated
: 2.1.0react-native-awesome-gallery
: 0.1.0 (also on 0.0.9)