pictureviewer: use getScrollBarData() function

Origin commit data
------------------
Branch: ni/coolstream
Commit: 126d60527b
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-06-14 (Wed, 14 Jun 2017)

Origin message was:
------------------
- pictureviewer: use getScrollBarData() function

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2017-06-14 14:57:09 +02:00
parent ba50008ddf
commit 166258a54f

View File

@@ -760,9 +760,9 @@ void CPictureViewerGui::paint()
}
//scrollbar
int _listmaxshow = listmaxshow ? listmaxshow : 1; //avoid division by zero
int total_pages = playlist.size() == 0 ? 1 : ((playlist.size() - 1) / _listmaxshow) + 1;
int current_page = selected / _listmaxshow;
int total_pages;
int current_page;
getScrollBarData(&total_pages, &current_page, playlist.size(), listmaxshow, selected);
paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page);