[IOS] Always send swipe events, left the receiver to handle it or not.
authorulion <ulion2002@gmail.com>
Fri, 22 Mar 2013 04:08:10 +0000 (12:08 +0800)
committerulion <ulion2002@gmail.com>
Fri, 22 Mar 2013 04:13:01 +0000 (12:13 +0800)
xbmc/osx/ios/XBMCController.mm

index 0afa407..10c2c69 100644 (file)
@@ -584,48 +584,30 @@ AnnounceReceiver *AnnounceReceiver::g_announceReceiver = NULL;
     
     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]);
     }
   }
 }