Skip to content

fix: Reset scale to initial value when zooming out below original size#488

Merged
dev-yakuza merged 1 commit intodev-yakuza:mainfrom
devi-r:fix/reset-scale-on-zoom-out
Mar 10, 2026
Merged

fix: Reset scale to initial value when zooming out below original size#488
dev-yakuza merged 1 commit intodev-yakuza:mainfrom
devi-r:fix/reset-scale-on-zoom-out

Conversation

@devi-r
Copy link
Contributor

@devi-r devi-r commented Mar 10, 2026

Problem:

When pinch-zooming out below the original scale and releasing, the image appears permanently shrunken. This happens because handlePanResponderReleaseResolve only animates the position back to center but doesn't reset the scale back to INITIAL_SCALE.

Fix:

Added the missing animateToScale(INITIAL_SCALE) call in the zoom-out release path (_scale.current < INITIAL_SCALE), so the image snaps back to its original size on release. This is consistent with how position is already being reset.

Before After
before.mp4
after.mp4

When pinch-zooming out below the original scale and releasing, only the
position was being animated back to center but the scale was not reset,
causing the image to appear permanently shrunken. This adds the missing
animateToScale(INITIAL_SCALE) call to snap the image back to its
original size on release.
@devi-r devi-r removed their assignment Mar 10, 2026
Copy link
Owner

@dev-yakuza dev-yakuza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devi-r LGTM 👍

Thanks for your contribution. 🙇

@dev-yakuza dev-yakuza merged commit 5293ece into dev-yakuza:main Mar 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants