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

Commit

Permalink
fix: properly normalize velocity
Browse files Browse the repository at this point in the history
satya164 committed Aug 18, 2019
1 parent f252adc commit f2e3c2b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/stack/src/views/Stack/Card.tsx
Original file line number Diff line number Diff line change
@@ -68,6 +68,7 @@ const {
lessThan,
max,
min,
multiply,
neq,
onChange,
or,
@@ -167,7 +168,10 @@ export default class Card extends React.Component<Props> {
// But since we have 0-1 scale, we need to adjust the velocity
set(
this.transitionVelocity,
cond(this.distance, divide(this.velocity, this.distance), 0)
multiply(
cond(this.distance, divide(this.velocity, this.distance), 0),
-1
)
),
set(this.frameTime, 0),
set(this.transitionState.time, 0),

0 comments on commit f2e3c2b

Please sign in to comment.