fram-x / FluidTransitions

Fluid Transitions for React Navigation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

N1cholas opened this issue · comments

commented

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 }],
    }
  }