If we're showing a scrollbar, always show at least one unit
authorH. Peter Anvin <hpa@zytor.com>
Sat, 16 Feb 2008 08:13:50 +0000 (00:13 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Sat, 16 Feb 2008 08:13:50 +0000 (00:13 -0800)
In the simple menu system, if we're showing a scrollbar at all, always
show at least one unit of it.

com32/menu/menumain.c

index ff01328..4dbc66c 100644 (file)
@@ -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 */
   }