Skip to content

Commit

Permalink
fix all transform errors in the example (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBacon authored and jakub-gonet committed Jan 3, 2020
1 parent 757de23 commit 729814d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
6 changes: 2 additions & 4 deletions Example/Interactable.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,8 @@ class Interactable extends Component {
style,
{
transform: [
{
translateX: verticalOnly ? 0 : this._transX,
translateY: horizontalOnly ? 0 : this._transY,
},
{ translateX: verticalOnly ? 0 : this._transX },
{ translateY: horizontalOnly ? 0 : this._transY },
],
},
]}>
Expand Down
19 changes: 10 additions & 9 deletions Example/chatHeads/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { Component } from 'react';
import { Dimensions, Image, View, StyleSheet } from 'react-native';
import Animated from 'react-native-reanimated';

import { Dimensions, StyleSheet, View } from 'react-native';
import { PanGestureHandler, State } from 'react-native-gesture-handler';
import Animated from 'react-native-reanimated';

const { width } = Dimensions.get('window');

Expand Down Expand Up @@ -63,14 +62,12 @@ class Tracking extends Component {

const gestureState = new Value(-1);
const dragVX = new Value(0);
const dragVY = new Value(0);

this._onGestureEvent = event([
{
nativeEvent: {
translationX: dragX,
velocityX: dragVX,
velocityY: dragVY,
state: gestureState,
translationY: dragY,
},
Expand Down Expand Up @@ -166,7 +163,8 @@ class Tracking extends Component {
styles.box,
{
transform: [
{ translateX: this.follow3x, translateY: this.follow3y },
{ translateX: this.follow3x },
{ translateY: this.follow3y },
],
},
]}
Expand All @@ -179,7 +177,8 @@ class Tracking extends Component {
styles.box,
{
transform: [
{ translateX: this.follow2x, translateY: this.follow2y },
{ translateX: this.follow2x },
{ translateY: this.follow2y },
],
},
]}
Expand All @@ -193,7 +192,8 @@ class Tracking extends Component {
styles.box,
{
transform: [
{ translateX: this.follow1x, translateY: this.follow1y },
{ translateX: this.follow1x },
{ translateY: this.follow1y },
],
},
]}
Expand All @@ -211,7 +211,8 @@ class Tracking extends Component {
styles.box,
{
transform: [
{ translateX: this._transX, translateY: this._transY },
{ translateX: this._transX },
{ translateY: this._transY },
],
},
]}
Expand Down

0 comments on commit 729814d

Please sign in to comment.