Skip to content
This repository
Browse code

GUI containers: adjust page control offset when scrolling down to mat…

…ch behaviour when scrolling up
  • Loading branch information...
commit 6a1880411cdde8d751642019efa8c3b0ad1531ab 1 parent 37f4181
Michal Piechowiak authored April 04, 2013 S. Davilla committed April 16, 2013
4  xbmc/guilib/GUIBaseContainer.cpp
@@ -140,7 +140,9 @@ void CGUIBaseContainer::Process(unsigned int currentTime, CDirtyRegionList &dirt
140 140
     current++;
141 141
   }
142 142
 
143  
-  UpdatePageControl(offset);
  143
+  // when we are scrolling up, offset will become lower (integer division, see offset calc)
  144
+  // to have same behaviour when scrolling down, we need to set page control to offset+1
  145
+  UpdatePageControl(offset + (m_scroller.IsScrollingDown() ? 1 : 0));
144 146
 
145 147
   CGUIControl::Process(currentTime, dirtyregions);
146 148
 }
4  xbmc/guilib/GUIPanelContainer.cpp
@@ -89,7 +89,9 @@ void CGUIPanelContainer::Process(unsigned int currentTime, CDirtyRegionList &dir
89 89
     current++;
90 90
   }
91 91
 
92  
-  UpdatePageControl(offset);
  92
+  // when we are scrolling up, offset will become lower (integer division, see offset calc)
  93
+  // to have same behaviour when scrolling down, we need to set page control to offset+1
  94
+  UpdatePageControl(offset + (m_scroller.IsScrollingDown() ? 1 : 0));
93 95
 
94 96
   CGUIControl::Process(currentTime, dirtyregions);
95 97
 }

0 notes on commit 6a18804

Please sign in to comment.
Something went wrong with that request. Please try again.