aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-19 18:25:08 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-02-19 18:25:08 -0800
commit3710870073b0183bb312c676392738207cd75616 (patch)
tree1abc62dc6880997fd218ae90765b70e9086c0f23
parentc758029be533c05d674251f204ca368be5d2c67f (diff)
downloadsyslinux.git-3710870073b0183bb312c676392738207cd75616.tar.gz
syslinux.git-3710870073b0183bb312c676392738207cd75616.tar.xz
syslinux.git-3710870073b0183bb312c676392738207cd75616.zip
Fix the scrollbar handling for insanely huge menus
The handling of the scrollbar for insanely huge menus was broken, causing it to disappear off the bottom of the menu window.
-rw-r--r--com32/menu/menumain.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index d5631982..2bbbc4f8 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -297,10 +297,9 @@ draw_menu(int sel, int top, int edit_line)
int tabmsg_len;
if ( cm->nentries > MENU_ROWS ) {
- int sblen = MENU_ROWS*MENU_ROWS/cm->nentries;
+ int sblen = max(MENU_ROWS*MENU_ROWS/cm->nentries, 1);
sbtop = (MENU_ROWS-sblen+1)*top/(cm->nentries-MENU_ROWS+1);
- sbbot = max(sbtop, sbtop+sblen-1);
-
+ sbbot = sbtop+sblen-1;
sbtop += 4; sbbot += 4; /* Starting row of scrollbar */
}