Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.

Commit 2ddf3a4

Browse files
christianbaronisatya164
authored andcommitted
fix: reduce card gesture velocity impact (#161)
1 parent 3ed1b28 commit 2ddf3a4

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/views/Stack/Card.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const UNSET = -1;
6060
const DIRECTION_VERTICAL = -1;
6161
const DIRECTION_HORIZONTAL = 1;
6262

63-
const SWIPE_VELOCITY_IMPACT = 0.01;
63+
const SWIPE_VELOCITY_IMPACT = 0.3;
6464

6565
/**
6666
* 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> {
246246
]);
247247
};
248248

249-
private velocitySignum = cond(
250-
this.velocity,
251-
divide(abs(this.velocity), this.velocity),
252-
0
253-
);
254249
private extrapolatedPosition = add(
255250
this.gesture,
256-
multiply(
257-
this.velocity,
258-
this.velocity,
259-
this.velocitySignum,
260-
SWIPE_VELOCITY_IMPACT
261-
)
251+
multiply(this.velocity, SWIPE_VELOCITY_IMPACT)
262252
);
263253

264254
private exec = block([

0 commit comments

Comments
 (0)