aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Levert <brlev@free.fr>2016-06-14 06:26:30 -0400
committerGene Cumm <gene.cumm@gmail.com>2016-06-14 06:47:42 -0400
commitfa1629d888d6ee6325fb2de346e49cdd76156ba0 (patch)
tree8267567fade57c2f9801685b3c4a8e0a8e368a74
parentb63fc468e1e4f178b2dd88d181ce76d2acd01e8b (diff)
downloadsyslinux-fa1629d888d6ee6325fb2de346e49cdd76156ba0.tar.gz
syslinux-fa1629d888d6ee6325fb2de346e49cdd76156ba0.tar.xz
syslinux-fa1629d888d6ee6325fb2de346e49cdd76156ba0.zip
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.c3
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 */