react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

imageViewer example panning not scaled on iOS

Open louispvb opened this issue 8 years ago • 4 comments

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.

louispvb avatar Jun 26 '18 21:06 louispvb

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),
...

Haper avatar Aug 03 '18 13:08 Haper

Thanks @Haper! This solved our issue.

sebastian-schlecht avatar Jan 03 '19 08:01 sebastian-schlecht

Thank you! @Haper

miodrage avatar Jan 03 '19 08:01 miodrage

Thanks @Haper for providing a working solution! 🎉

I'm closing this issue if you have any further questions feel free to reopen

jgonet avatar Nov 22 '19 12:11 jgonet