Picture/SlideShow support rotate picture by swipe up/down.
authorulion <ulion2002@gmail.com>
Mon, 25 Mar 2013 04:20:40 +0000 (12:20 +0800)
committerulion <ulion2002@gmail.com>
Tue, 26 Mar 2013 13:51:20 +0000 (21:51 +0800)
xbmc/pictures/GUIWindowSlideShow.cpp

index ebde6df..77fdc34 100644 (file)
@@ -772,6 +772,19 @@ bool CGUIWindowSlideShow::OnAction(const CAction &action)
     Zoom(m_iZoomFactor + 1);
     break;
 
+  case ACTION_GESTURE_SWIPE_UP:
+  case ACTION_GESTURE_SWIPE_DOWN:
+    if (m_iZoomFactor == 1 || !m_Image[m_iCurrentPic].m_bCanMoveVertically)
+    {
+      bool swipeOnLeft = action.GetAmount() < g_graphicsContext.GetWidth() / 2;
+      bool swipeUp = action.GetID() == ACTION_GESTURE_SWIPE_UP;
+      if (swipeUp == swipeOnLeft)
+        Rotate(90.0f);
+      else
+        Rotate(-90.0f);
+    }
+    break;
+
   case ACTION_ROTATE_PICTURE_CW:
     Rotate(90.0f);
     break;