Fix typo -- movedDistance moveX, moveY -> dy/dx (#1824)

This commit is contained in:
Neo
2017-06-23 11:26:54 +08:00
parent 59a85fabb2
commit a3baa099f9

View File

@@ -321,10 +321,10 @@ class CardStack extends Component {
const axisDistance = isVertical
? layout.height.__getValue()
: layout.width.__getValue();
const movedDistance = gesture[isVertical ? 'moveY' : 'moveX'];
const defaultVelocity = axisDistance / ANIMATION_DURATION;
const movedDistance = gesture[isVertical ? 'dy' : 'dx'];
const gestureVelocity = gesture[isVertical ? 'vy' : 'vx'];
const velocity = Math.max(gestureVelocity, defaultVelocity);
const defaultVelocity = axisDistance / ANIMATION_DURATION;
const velocity = Math.max(Math.abs(gestureVelocity), defaultVelocity);
const resetDuration = movedDistance / velocity;
const goBackDuration = (axisDistance - movedDistance) / velocity;