fix: reduce card gesture velocity impact (#161)

This commit is contained in:
Christian Baroni
2019-07-17 15:13:25 -07:00
committed by satyajit.happy
parent 7c86cfa88f
commit 81b1bdfb1e

View File

@@ -60,7 +60,7 @@ const UNSET = -1;
const DIRECTION_VERTICAL = -1;
const DIRECTION_HORIZONTAL = 1;
const SWIPE_VELOCITY_IMPACT = 0.01;
const SWIPE_VELOCITY_IMPACT = 0.3;
/**
* The distance of touch start from the edge of the screen where the gesture will be recognized
@@ -246,19 +246,9 @@ export default class Card extends React.Component<Props> {
]);
};
private velocitySignum = cond(
this.velocity,
divide(abs(this.velocity), this.velocity),
0
);
private extrapolatedPosition = add(
this.gesture,
multiply(
this.velocity,
this.velocity,
this.velocitySignum,
SWIPE_VELOCITY_IMPACT
)
multiply(this.velocity, SWIPE_VELOCITY_IMPACT)
);
private exec = block([