Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1373 from Montellese/slideshow_zoomed_next

slideshow: allow moving between pictures when not zoomed enough
  • Loading branch information...
commit dfaed24010c0c05fbf5e0dd5488f1db9ec618fe9 2 parents ec13322 + 266f4d8
@Montellese Montellese authored
View
17 xbmc/pictures/GUIWindowSlideShow.cpp
@@ -222,6 +222,9 @@ void CGUIWindowSlideShow::ShowNext()
m_iNextSlide = 0;
m_iDirection = 1;
+ m_iZoomFactor = 1;
+ m_fZoom = 1.0f;
+ m_fRotate = 0.0f;
m_bLoadNextPic = true;
}
@@ -233,7 +236,11 @@ void CGUIWindowSlideShow::ShowPrevious()
m_iNextSlide = m_iCurrentSlide - 1;
if (m_iNextSlide < 0)
m_iNextSlide = m_slides->Size() - 1;
+
m_iDirection = -1;
+ m_iZoomFactor = 1;
+ m_fZoom = 1.0f;
+ m_fRotate = 0.0f;
m_bLoadNextPic = true;
}
@@ -480,7 +487,8 @@ void CGUIWindowSlideShow::Process(unsigned int currentTime, CDirtyRegionList &re
m_iCurrentSlide = m_iNextSlide;
m_iNextSlide = GetNextSlide();
-// m_iZoomFactor = 1;
+ m_iZoomFactor = 1;
+ m_fZoom = 1.0f;
m_fRotate = 0.0f;
}
@@ -531,7 +539,7 @@ EVENT_RESULT CGUIWindowSlideShow::OnMouseEvent(const CPoint &point, const CMouse
}
else if (event.m_id == ACTION_GESTURE_PAN)
{ // on zoomlevel 1 just detect swipe left and right
- if (m_iZoomFactor == 1)
+ if (m_iZoomFactor == 1 || !m_Image[m_iCurrentPic].m_bCanMoveHorizontally)
{
if (m_firstGesturePoint.x > 0 && fabs(point.x - m_firstGesturePoint.x) > 100)
{
@@ -618,14 +626,14 @@ bool CGUIWindowSlideShow::OnAction(const CAction &action)
break;
case ACTION_MOVE_RIGHT:
- if (m_iZoomFactor == 1)
+ if (m_iZoomFactor == 1 || !m_Image[m_iCurrentPic].m_bCanMoveHorizontally)
ShowNext();
else
Move(PICTURE_MOVE_AMOUNT, 0);
break;
case ACTION_MOVE_LEFT:
- if (m_iZoomFactor == 1)
+ if (m_iZoomFactor == 1 || !m_Image[m_iCurrentPic].m_bCanMoveHorizontally)
ShowPrevious();
else
Move( -PICTURE_MOVE_AMOUNT, 0);
@@ -921,7 +929,6 @@ void CGUIWindowSlideShow::OnLoadPic(int iPic, int iSlideNumber, CBaseTexture* pT
else
m_Image[iPic].SetTexture(iSlideNumber, pTexture, CSlideShowPic::EFFECT_NO_TIMEOUT);
m_Image[iPic].SetOriginalSize(iOriginalWidth, iOriginalHeight, bFullSize);
- m_Image[iPic].Zoom(m_fZoom, true);
m_Image[iPic].m_bIsComic = false;
if (URIUtils::IsInRAR(m_slides->Get(m_iCurrentSlide)->GetPath()) || URIUtils::IsInZIP(m_slides->Get(m_iCurrentSlide)->GetPath())) // move to top for cbr/cbz
View
1  xbmc/pictures/SlideShowPicture.cpp
@@ -441,6 +441,7 @@ void CSlideShowPic::Process(unsigned int currentTime, CDirtyRegionList &dirtyreg
}
float w = maxx - minx;
float h = maxy - miny;
+ m_bCanMoveHorizontally = (w >= fScreenWidth);
if (w >= fScreenWidth)
{ // must have no black bars
if (minx + m_fZoomLeft*w > fOffsetX)
View
1  xbmc/pictures/SlideShowPicture.h
@@ -79,6 +79,7 @@ class CSlideShowPic
float GetZoom() const { return m_fZoomAmount;};
bool m_bIsComic;
+ bool m_bCanMoveHorizontally;
private:
void UpdateVertices(float cur_x[4], float cur_y[4], const float new_x[4], const float new_y[4], CDirtyRegionList &dirtyregions);
void Render(float *x, float *y, CBaseTexture* pTexture, color_t color);
Please sign in to comment.
Something went wrong with that request. Please try again.