From 3710870073b0183bb312c676392738207cd75616 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 19 Feb 2008 18:25:08 -0800 Subject: [PATCH] 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. --- com32/menu/menumain.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c index d563198..2bbbc4f 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 */ } -- 2.7.4