summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2015-05-02 20:03:02 +0200
committerchriszero <zerov83@gmail.com>2015-05-02 20:03:02 +0200
commit6708c32ab31bb90781bb5e3743cb81ae72748edd (patch)
tree84447e446f6487de611978b108614d02aad41d26
parentf7448c90f3c27f44cca77bdf2399d4321ef990a2 (diff)
downloadvdr-plugin-plex-6708c32ab31bb90781bb5e3743cb81ae72748edd.tar.gz
vdr-plugin-plex-6708c32ab31bb90781bb5e3743cb81ae72748edd.tar.bz2
Fixes scrolling in grid.
-rw-r--r--viewGridNavigator.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/viewGridNavigator.cpp b/viewGridNavigator.cpp
index e315008..91d7540 100644
--- a/viewGridNavigator.cpp
+++ b/viewGridNavigator.cpp
@@ -50,23 +50,6 @@ void cViewGridNavigator::FilterElements(int scrollOffset)
endOffset = (m_rows * m_columns) + scrollOffset;
}
- std::vector<cGridElement*>::iterator begin = m_firstElementIter + startOffset;
- std::vector<cGridElement*>::iterator end = m_firstElementIter + endOffset;
- if(end > m_vElements.end()) end = m_vElements.end();
-
- int pos = 0;
- for(std::vector<cGridElement*>::iterator it = begin; it != end; ++it) {
- cGridElement *elem = *it;
- elem->Position = pos++;
- SetGridElementData(elem);
- }
-
- if(m_setIterator) {
- m_activeElementIter = begin;
- m_pGrid->SetCurrent((*m_activeElementIter)->GridElementId(), true);
- m_setIterator = false;
- }
-
//remove non visible elements from grid
if(scrollOffset !=0 ) {
auto startIt = m_firstElementIter;
@@ -88,6 +71,23 @@ void cViewGridNavigator::FilterElements(int scrollOffset)
}
}
+ std::vector<cGridElement*>::iterator begin = m_firstElementIter + startOffset;
+ std::vector<cGridElement*>::iterator end = m_firstElementIter + endOffset;
+ if(end > m_vElements.end()) end = m_vElements.end();
+
+ int pos = 0;
+ for(std::vector<cGridElement*>::iterator it = begin; it != end; ++it) {
+ cGridElement *elem = *it;
+ elem->Position = pos++;
+ SetGridElementData(elem);
+ }
+
+ if(m_setIterator) {
+ m_activeElementIter = begin;
+ m_pGrid->SetCurrent((*m_activeElementIter)->GridElementId(), true);
+ m_setIterator = false;
+ }
+
m_firstElementIter = begin;
m_lastElementIter = end;
m_newDimensions = false;