mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
avoid division by zero
This commit is contained in:
@@ -469,8 +469,10 @@ void CBookmarkManager::paint()
|
|||||||
int ypos = y+ theight;
|
int ypos = y+ theight;
|
||||||
int sb = 2*fheight* listmaxshow;
|
int sb = 2*fheight* listmaxshow;
|
||||||
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
|
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
|
||||||
|
unsigned int tmp_max = listmaxshow;
|
||||||
int sbc= ((bookmarks.size()- 1)/ listmaxshow)+ 1;
|
if(!tmp_max)
|
||||||
|
tmp_max = 1;
|
||||||
|
int sbc= ((bookmarks.size()- 1)/ tmp_max)+ 1;
|
||||||
if (sbc < 1)
|
if (sbc < 1)
|
||||||
sbc = 1;
|
sbc = 1;
|
||||||
|
|
||||||
|
@@ -881,8 +881,10 @@ void CTimerList::paint()
|
|||||||
int ypos = y+ theight;
|
int ypos = y+ theight;
|
||||||
int sb = 2*fheight* listmaxshow;
|
int sb = 2*fheight* listmaxshow;
|
||||||
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
|
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
|
||||||
|
unsigned int tmp_max = listmaxshow;
|
||||||
int sbc= ((timerlist.size()- 1)/ listmaxshow)+ 1;
|
if(!tmp_max)
|
||||||
|
tmp_max = 1;
|
||||||
|
int sbc= ((timerlist.size()- 1)/ tmp_max)+ 1;
|
||||||
|
|
||||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ page_nr * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3, RADIUS_SMALL);
|
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ page_nr * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3, RADIUS_SMALL);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user