Permalink
Browse files

Merge pull request #2480 from ulion/ios_swipe_fix

[IOS] [Fix] Always send swipe events, left the receiver to handle it or not.
  • Loading branch information...
2 parents be6d3a7 + a0b2dc2 commit f96d7b3008b80c05d38dc8f53bdf896af922ec32 @Memphiz Memphiz committed Mar 26, 2013
Showing with 18 additions and 36 deletions.
  1. +18 −36 xbmc/osx/ios/XBMCController.mm
@@ -584,48 +584,30 @@ - (IBAction)handleSwipe:(UISwipeGestureRecognizer *)sender
if (sender.state == UIGestureRecognizerStateRecognized)
{
- bool swipeAllowed = false;
CGPoint point = [sender locationOfTouch:0 inView:m_glView];
point.x *= screenScale;
point.y *= screenScale;
- swipeAllowed = false;
- if ([sender numberOfTouches] == 2)
+ TouchMoveDirection direction = TouchMoveDirectionNone;
+ switch ([sender direction])
{
- swipeAllowed = true;
- }
- else
- {
- int gestures = CGenericTouchActionHandler::Get().QuerySupportedGestures(point.x, point.y);
- if (gestures & EVENT_RESULT_SWIPE)
- {
- swipeAllowed = true;
- }
- }
-
- if (swipeAllowed)
- {
- TouchMoveDirection direction = TouchMoveDirectionNone;
- switch ([sender direction])
- {
- case UISwipeGestureRecognizerDirectionRight:
- direction = TouchMoveDirectionRight;
- break;
- case UISwipeGestureRecognizerDirectionLeft:
- direction = TouchMoveDirectionLeft;
- break;
- case UISwipeGestureRecognizerDirectionUp:
- direction = TouchMoveDirectionUp;
- break;
- case UISwipeGestureRecognizerDirectionDown:
- direction = TouchMoveDirectionDown;
- break;
- }
- CGenericTouchActionHandler::Get().OnSwipe(direction,
- 0.0, 0.0,
- point.x, point.y, 0, 0,
- [sender numberOfTouches]);
+ case UISwipeGestureRecognizerDirectionRight:
+ direction = TouchMoveDirectionRight;
+ break;
+ case UISwipeGestureRecognizerDirectionLeft:
+ direction = TouchMoveDirectionLeft;
+ break;
+ case UISwipeGestureRecognizerDirectionUp:
+ direction = TouchMoveDirectionUp;
+ break;
+ case UISwipeGestureRecognizerDirectionDown:
+ direction = TouchMoveDirectionDown;
+ break;
}
+ CGenericTouchActionHandler::Get().OnSwipe(direction,
+ 0.0, 0.0,
+ point.x, point.y, 0, 0,
+ [sender numberOfTouches]);
}
}
}

0 comments on commit f96d7b3

Please sign in to comment.