From 81b1bdfb1e3566bc8b6f43cde274fba4bc8d6027 Mon Sep 17 00:00:00 2001 From: Christian Baroni Date: Wed, 17 Jul 2019 15:13:25 -0700 Subject: [PATCH] fix: reduce card gesture velocity impact (#161) --- packages/stack/src/views/Stack/Card.tsx | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/stack/src/views/Stack/Card.tsx b/packages/stack/src/views/Stack/Card.tsx index cebefd9b..ac5b5c0d 100755 --- a/packages/stack/src/views/Stack/Card.tsx +++ b/packages/stack/src/views/Stack/Card.tsx @@ -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 { ]); }; - 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([