fram-x / FluidTransitions

Fluid Transitions for React Navigation
MIT License
2.93k stars 194 forks source link

How to solve the inaccurate moving distance caused by zooming while moving? #236

Open N1cholas opened 4 years ago

N1cholas commented 4 years ago

Scenario: Moving down 100 while zooming 2 times

Result: Moving distance less than 100

handleAnimate = ({ progress }) => {
    const scaleInterpolation = progress.interpolate({
      inputRange: [0, 1],
      outputRange: [1, 2],
    })
    const translateYInterpolation = progress.interpolate({
      inputRange: [0, 1],
      outputRange: [0, 100],
    })
    return {
      transform: [{ translateY: translateYInterpolation }, { scale: scaleInterpolation }],
    }
  }