diff options
author | Bruno Levert <brlev@free.fr> | 2016-06-14 06:26:30 -0400 |
---|---|---|
committer | Gene Cumm <gene.cumm@gmail.com> | 2016-06-14 06:47:42 -0400 |
commit | fa1629d888d6ee6325fb2de346e49cdd76156ba0 (patch) | |
tree | 8267567fade57c2f9801685b3c4a8e0a8e368a74 | |
parent | b63fc468e1e4f178b2dd88d181ce76d2acd01e8b (diff) | |
download | syslinux-fa1629d888d6ee6325fb2de346e49cdd76156ba0.tar.gz |
menu: Apply VSHIFT to scrollbar
When VSHIFT is used, the scrollbar's position is relative to the old
position.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
-rw-r--r-- | com32/menu/menumain.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 */ |