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

Fixes android issue with scaling on android #148

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LimitedDani
Copy link

No description provided.

@LimitedDani
Copy link
Author

And if merging this is taking you to long, I published a package with the fix: https://www.npmjs.com/package/better-react-native-image-viewing

@@ -22,6 +22,7 @@ import {
getDistanceBetweenTouches,
getImageTranslate,
getImageDimensionsByTranslate,
getImageTransform,
Copy link
Collaborator

@antonKalinin antonKalinin May 30, 2022

Choose a reason for hiding this comment

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

Hey @LimitedDani thanks for this PR, can I ask you what this import for as it's never used below?

Copy link
Author

Choose a reason for hiding this comment

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

Ummm, i dont know, i will remove it

Copy link
Author

Choose a reason for hiding this comment

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

@antonKalinin It is fixed

const imageDimensions = getImageDimensionsByTranslate(
initialTranslate,
SCREEN
);

useEffect(() => {
Copy link
Collaborator

@antonKalinin antonKalinin Jun 8, 2022

Choose a reason for hiding this comment

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

@LimitedDani Sorry that it takes so long to merge this one, I am unfortunately pretty busy and have very limited time for OS. But I need to ask couple of questions here:

  1. Why do we need Animated.parallel having single animation in array?
  2. Can you shortly describe the idea, because the approach looks a bit hacky for me. From what I understand we run this effect on every render (no deps) and we say that zoom is over (onZoom(false)) and we animate zoom back to initial scale.
    What was initial problem we are solving? Was it that image stacked after pinch gesture and we were about to return it to initial scale?

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