react-native-reanimated
react-native-reanimated copied to clipboard
imageViewer example panning not scaled on iOS
I tried out the imageViewer example and when you zoom in on iOS, the panning translation does not scale with the zoom. So when zoomed in and panning, the image will move slower than the touch.
On android this worked correctly.
function dragDiff(value, updating, scale) {
const tmp = new Value(0);
const prev = new Value(0);
const corValue = Platform.OS === 'ios' ? multiply(value, scale) : value;
return cond(
updating,
[set(tmp, sub(corValue, prev)), set(prev, corValue), tmp],
set(prev, 0)
);
}
...
dragDiff(dragX, panActive, scale),
...
dragDiff(dragY, panActive, scale),
...
Thanks @Haper! This solved our issue.
Thank you! @Haper
Thanks @Haper for providing a working solution! 🎉
I'm closing this issue if you have any further questions feel free to reopen