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

Commit

Permalink
fix: reduce card gesture velocity impact (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbaroni authored and satya164 committed Aug 18, 2019
1 parent 7c86cfa commit 81b1bdf
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions packages/stack/src/views/Stack/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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([
Expand Down

0 comments on commit 81b1bdf

Please sign in to comment.