Adjust velocity factor

This commit is contained in:
Dan Abramov
2024-11-02 15:43:05 +00:00
parent ca945a9871
commit 092494f891
+1 -1
View File
@@ -138,7 +138,7 @@ function ImageViewing({
if (Math.abs(e.velocityY) > 1000) { if (Math.abs(e.velocityY) > 1000) {
dismissSwipeTranslateY.value = withDecay({ dismissSwipeTranslateY.value = withDecay({
velocity: e.velocityY, velocity: e.velocityY,
velocityFactor: 2, velocityFactor: Math.max(3000 / Math.abs(e.velocityY), 1), // Speed up if it's too slow.
deceleration: 1, // Danger! This relies on the reaction below stopping it. deceleration: 1, // Danger! This relies on the reaction below stopping it.
}) })
} else { } else {