Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [35383] zoomed large image disappears from preview if triple tap on the bottom of the screen #35931

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/MultiGestureCanvas/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ function MultiGestureCanvas({
pinchScale.value = 1;

if (animated) {
offsetX.value = withSpring(0, SPRING_CONFIG);
offsetY.value = withSpring(0, SPRING_CONFIG);
offsetX.value = 0;
offsetY.value = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

The accepted proposal contained a different fix
offsetY.value = withSpring(0, {...SPRING_CONFIG, duration: 0});
Is there a reason you've decided to use offsetY.value = 0?
(Just want to understand this better, this does work fine)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hi @eVoloshchak, my apologies for modifying the approved proposal.

The withSpring(0, {...SPRING_CONFIG, duration: 0}) function is causing a typing error. Given that withSpring is designed for generating animated effects, specifying duration: 0 essentially eliminates the animation entirely.

I've made changes to directly set offsetY.value = 0 instead, which promptly reduces the value to 0 with the same outcome (no animation).

panTranslateX.value = withSpring(0, SPRING_CONFIG);
panTranslateY.value = withSpring(0, SPRING_CONFIG);
pinchTranslateX.value = withSpring(0, SPRING_CONFIG);
Expand Down
Loading