Skip to content

Commit

Permalink
Merge pull request #8 from intergalacticspacehighway/zoom-in-list
Browse files Browse the repository at this point in the history
some nits
  • Loading branch information
intergalacticspacehighway authored Jun 18, 2022
2 parents fd54604 + 96e2da5 commit 321b26c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-reanimated-zoom",
"version": "0.1.2",
"version": "0.1.4",
"description": "Component to add zoom in react native views.",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down Expand Up @@ -64,10 +64,10 @@
"react": "16.13.1",
"react-native": "0.63.4",
"react-native-builder-bob": "^0.18.2",
"release-it": "^14.2.2",
"typescript": "^4.1.3",
"react-native-gesture-handler": "~2.1.0",
"react-native-reanimated": "~2.3.1"
"react-native-reanimated": "~2.3.1",
"release-it": "^14.2.2",
"typescript": "^4.1.3"
},
"peerDependencies": {
"react": "*",
Expand Down
9 changes: 4 additions & 5 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Animated, {
withTiming,
cancelAnimation,
runOnJS,
withSpring,
} from 'react-native-reanimated';
import { Gesture, GestureDetector } from 'react-native-gesture-handler';

Expand Down Expand Up @@ -78,17 +77,17 @@ export function Zoom(props: Props) {
prevTranslationY.value + e.translationY - panTranslateY.value;

if (nextTranslateX > maxTranslateX) {
translationX.value = withSpring(maxTranslateX);
translationX.value = maxTranslateX;
} else if (nextTranslateX < minTranslateX) {
translationX.value = withSpring(minTranslateX);
translationX.value = minTranslateX;
} else {
translationX.value = nextTranslateX;
}

if (nextTranslateY > maxTranslateY) {
translationY.value = withSpring(maxTranslateX);
translationY.value = maxTranslateX;
} else if (nextTranslateY < minTranslateY) {
translationY.value = withSpring(minTranslateY);
translationY.value = minTranslateY;
} else {
translationY.value = nextTranslateY;
}
Expand Down

0 comments on commit 321b26c

Please sign in to comment.