From: H. Peter Anvin Date: Sat, 16 Feb 2008 08:13:50 +0000 (-0800) Subject: If we're showing a scrollbar, always show at least one unit X-Git-Tag: syslinux-3.62-pre8~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d3ed8cb31a485cb4263cd22ca5f60c73b6166752;p=profile%2Fivi%2Fsyslinux.git If we're showing a scrollbar, always show at least one unit In the simple menu system, if we're showing a scrollbar at all, always show at least one unit of it. --- diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c index ff01328..4dbc66c 100644 --- a/com32/menu/menumain.c +++ b/com32/menu/menumain.c @@ -415,7 +415,7 @@ draw_menu(int sel, int top, int edit_line) if ( nentries > MENU_ROWS ) { int sblen = MENU_ROWS*MENU_ROWS/nentries; sbtop = (MENU_ROWS-sblen+1)*top/(nentries-MENU_ROWS+1); - sbbot = sbtop + sblen - 1; + sbbot = max(sbtop, sbtop+sblen-1); sbtop += 4; sbbot += 4; /* Starting row of scrollbar */ }