diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 6d609fa44..ff513bcd6 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1898,6 +1898,8 @@ void CAudioPlayerGui::paint() int sbc = ((m_playlist.size() - 1) / m_listmaxshow) + 1; int sbs = (m_selected / m_listmaxshow); + if (sbc < 1) + sbc = 1; m_frameBuffer->paintBoxRel(m_x + m_width - 13, ypos + 2 + sbs*(sb-4)/sbc , 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3, RADIUS_SMALL); } diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index da06d8320..52c2d6e44 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -121,6 +121,8 @@ void CBEBouquetWidget::paint() int sbc= ((Bouquets->size()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); + if (sbc < 1) + sbc = 1; //scrollbar frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 430ff1d94..fd8d99687 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -160,6 +160,8 @@ void CBEChannelWidget::paint() int sbc= ((Channels->size()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); + if (sbc < 1) + sbc = 1; frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); } diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index c7e41c2d2..8453f1ff4 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -482,6 +482,8 @@ void CBookmarkManager::paint() frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); int sbc= ((bookmarks.size()- 1)/ listmaxshow)+ 1; + if (sbc < 1) + sbc = 1; frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ page_nr * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); } diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index a727b0ba6..7d798ec19 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -618,7 +618,7 @@ void CBouquetList::paint() int sb = fheight* listmaxshow; frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - int sbc= ((bsize - 1)/ listmaxshow)+ 1; + int sbc= ((bsize - 1)/ listmaxshow)+ 1; /* bsize is > 0, so sbc is also > 0 */ int sbs= (selected/listmaxshow); frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 87359d968..01468a858 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2128,8 +2128,10 @@ void CChannelList::paint() const int sb = height - theight - footerHeight; // paint scrollbar over full height of main box frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - const int sbc= ((chanlist.size()- 1)/ listmaxshow)+ 1; + int sbc= ((chanlist.size()- 1)/ listmaxshow)+ 1; const int sbs= (selected/listmaxshow); + if (sbc < 1) + sbc = 1; frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); showChannelLogo(); diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 495e1b046..67855cda3 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -263,6 +263,8 @@ void CEpgData::showText( int startPos, int ypos ) int sbc = ((textSize - 1)/ medlinecount) + 1; int sbs= (startPos+ 1)/ medlinecount; + if (sbc < 1) + sbc = 1; frameBuffer->paintBoxRel(sx+ ox- 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1); // scrollbar bg frameBuffer->paintBoxRel(sx+ ox- 13, ypos+ 2+ sbs*(sb-4)/sbc , 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); // scrollbar } diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 08d2d083a..42ae1709f 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -918,6 +918,8 @@ void CNeutrinoEventList::paint(t_channel_id channel_id) int sbc= ((evtlist.size()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); + if (sbc < 1) + sbc = 1; frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index c303f2d89..ab3de69d7 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1527,6 +1527,8 @@ void CFileBrowser::paint() int sbc= ((filelist.size()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); + if (sbc < 1) + sbc = 1; frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3, RADIUS_SMALL); } diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 3e24e9f05..055de3006 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -764,6 +764,8 @@ void CPictureViewerGui::paint() int sbc= ((playlist.size()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); + if (sbc < 1) + sbc = 1; frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index 5375d538a..7e64a639c 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -71,6 +71,8 @@ void CListBox::paint() int sbc= ((getItemCount()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); + if (sbc < 1) + sbc = 1; frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); }