From 2144081d0aa6c2ee292451917e17965992c24fa5 Mon Sep 17 00:00:00 2001 From: Florine BECQUET Date: Fri, 12 Jun 2015 07:38:29 +0200 Subject: [PATCH] Change translation when draggable view touch max config --- ios/Classes/TiDraggableGesture.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ios/Classes/TiDraggableGesture.m b/ios/Classes/TiDraggableGesture.m index c864515..c8c19f0 100644 --- a/ios/Classes/TiDraggableGesture.m +++ b/ios/Classes/TiDraggableGesture.m @@ -185,19 +185,23 @@ - (void)panDetected:(UIPanGestureRecognizer *)panRecognizer if(hasMaxLeft && newCenter.x - size.width / 2 > maxLeft) { newCenter.x = maxLeft + size.width / 2; + tmpTranslationX = newCenter.x - self.proxy.view.center.x; } else if(hasMinLeft && newCenter.x - size.width / 2 < minLeft) { newCenter.x = minLeft + size.width / 2; + tmpTranslationX = newCenter.x - self.proxy.view.center.x; } if(hasMaxTop && newCenter.y - size.height / 2 > maxTop) { newCenter.y = maxTop + size.height / 2; + tmpTranslationY = newCenter.y - self.proxy.view.center.y; } else if(hasMinTop && newCenter.y - size.height / 2 < minTop) { newCenter.y = minTop + size.height / 2; + tmpTranslationY = newCenter.y - self.proxy.view.center.y; } }