Skip to content

Commit 1dc0343

Browse files
committed
Make toss configurable
1 parent d30d38c commit 1dc0343

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const magic = {
2020
deceleration: 0.999,
2121
bouncyFactor: 1,
2222
velocityFactor: P(1, 1.2),
23-
tossForMaster: 0.4,
23+
toss: 0.4,
2424
coefForTranslatingVelocities: 5
2525
}
2626

@@ -34,7 +34,7 @@ const {
3434
restDisplacementThreshold,
3535
deceleration,
3636
velocityFactor,
37-
tossForMaster
37+
toss
3838
} = magic
3939

4040

@@ -147,6 +147,7 @@ export default class BottomSheetBehavior extends Component {
147147
const masterOffseted =
148148
new Value(init)
149149
// destination point is a approximation of movement if finger released
150+
const tossForMaster = props.springConfig.hasOwnProperty('toss') ? props.springConfig.toss : toss
150151
const destinationPoint = add(masterOffseted, multiply(tossForMaster, this.masterVelocity))
151152
// method for generating condition for finding the nearest snap point
152153
const currentSnapPoint = (i = 0) => i + 1 === snapPoints.length ?

0 commit comments

Comments
 (0)