[syslinux:master] menu: Apply VSHIFT to scrollbar

syslinux-bot for Bruno Levert brlev at free.fr
Tue Jun 14 03:51:04 PDT 2016


Commit-ID:  fa1629d888d6ee6325fb2de346e49cdd76156ba0
Gitweb:     http://www.syslinux.org/commit/fa1629d888d6ee6325fb2de346e49cdd76156ba0
Author:     Bruno Levert <brlev at free.fr>
AuthorDate: Tue, 14 Jun 2016 06:26:30 -0400
Committer:  Gene Cumm <gene.cumm at gmail.com>
CommitDate: Tue, 14 Jun 2016 06:47:42 -0400

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 at gmail.com>

---
 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 ed72c08..330bbc4 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 */


More information about the Syslinux-commits mailing list