@@ -21,7 +21,7 @@ export default function injectDependencies( Animated, PanResponder ){
2121 verticalOnly : PropTypes . bool ,
2222 dragWithSprings : PropTypes . bool ,
2323 dragEnabled : PropTypes . bool ,
24- // animatedValueX: PropTypes.instanceOf(Animated.Value),
24+ animatedValueX : PropTypes . instanceOf ( Animated . Value ) ,
2525 // animatedValueY: PropTypes.instanceOf(Animated.Value),
2626 onSnap : PropTypes . func ,
2727 onSnapStart : PropTypes . func ,
@@ -86,6 +86,11 @@ export default function injectDependencies( Animated, PanResponder ){
8686
8787 render ( ) {
8888 let { x, y } = this . getAnimated ( )
89+ console . log ( x === this . lastX , y === this . lastY )
90+ this . lastX = x
91+ this . lastY = y
92+
93+
8994 let position = {
9095 transform : [
9196 { translateX : x } , { translateY : y }
@@ -159,6 +164,7 @@ export default function injectDependencies( Animated, PanResponder ){
159164 onPanResponderGrant : ( e , { x0, y0} ) => {
160165 let { x, y} = this . getAnimated ( )
161166 let offset = { x : x . _value , y : y . _value }
167+ this . lastEnd = offset
162168 x . setOffset ( offset . x )
163169 y . setOffset ( offset . y )
164170 x . setValue ( 0 )
@@ -206,6 +212,8 @@ export default function injectDependencies( Animated, PanResponder ){
206212 this . dragStartLocation = { x : ev . x , y : ev . y }
207213 this . animator . removeTempBehaviors ( ) ;
208214 this . animator . isDragging = true
215+ this . animator . vx = 0
216+ this . animator . vy = 0
209217 this . addTempDragBehavior ( this . props . dragWithSprings ) ;
210218 }
211219
@@ -228,6 +236,7 @@ export default function injectDependencies( Animated, PanResponder ){
228236 y : y + this . lastEnd . y + toss * velocity . y
229237 } ;
230238
239+ console . log ( 'pc' , projectedCenter , velocity , this . lastEnd )
231240 let snapPoint = Utils . findClosest ( projectedCenter , this . props . snapPoints ) ;
232241 let targetSnapPointId = snapPoint && snapPoint . id || "" ;
233242
@@ -318,6 +327,7 @@ export default function injectDependencies( Animated, PanResponder ){
318327 }
319328
320329 componentDidUpdate ( prevProps ) {
330+ console . log ( 'updated' )
321331 this . setPropBehaviours ( prevProps , this . props )
322332 }
323333
0 commit comments