From fa1629d888d6ee6325fb2de346e49cdd76156ba0 Mon Sep 17 00:00:00 2001 From: Bruno Levert Date: Tue, 14 Jun 2016 06:26:30 -0400 Subject: menu: Apply VSHIFT to scrollbar When VSHIFT is used, the scrollbar's position is relative to the old position. Signed-off-by: Gene Cumm --- com32/menu/menumain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c index ed72c087..330bbc4f 100644 --- a/com32/menu/menumain.c +++ b/com32/menu/menumain.c @@ -306,7 +306,8 @@ static void draw_menu(int sel, int top, int edit_line) if (cm->nentries > MENU_ROWS) { int sblen = max(MENU_ROWS * MENU_ROWS / cm->nentries, 1); - sbtop = (MENU_ROWS - sblen + 1) * top / (cm->nentries - MENU_ROWS + 1); + sbtop = ((MENU_ROWS - sblen + 1) * top / + (cm->nentries - MENU_ROWS + 1)) + VSHIFT; sbbot = sbtop + sblen - 1; sbtop += 4; sbbot += 4; /* Starting row of scrollbar */ -- cgit v1.2.1