Skip to content

Commit

Permalink
fix: don't close if swipe down occurs when image zoomed in
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed Feb 21, 2024
1 parent 25418ab commit 0293460
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/MultiGestureCanvas/usePanGesture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const usePanGesture = ({
const finalTranslateY = offsetY.value + panVelocityY.value * 0.2;

// TODO: calculate these values (250/500) programmatically
if (finalTranslateY > 250) {
if (finalTranslateY > 250 && zoomScale.value <= 1) {
offsetY.value = withSpring(500, SPRING_CONFIG, () => {
isSwipingDownToClose.value = false;
});
Expand Down

0 comments on commit 0293460

Please sign in to comment.