-
Notifications
You must be signed in to change notification settings - Fork 291
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
base: master
Are you sure you want to change the base?
Conversation
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 |
src/hooks/usePanResponder.ts
Outdated
@@ -22,6 +22,7 @@ import { | |||
getDistanceBetweenTouches, | |||
getImageTranslate, | |||
getImageDimensionsByTranslate, | |||
getImageTransform, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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(() => { |
There was a problem hiding this comment.
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:
- Why do we need
Animated.parallel
having single animation in array? - 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?
No description provided.