Skip to content

Commit

Permalink
menu: Apply VSHIFT to scrollbar
Browse files Browse the repository at this point in the history
When VSHIFT is used, the scrollbar's position is relative to the old
position.

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
  • Loading branch information
nobur authored and geneC committed Jun 14, 2016
1 parent b63fc46 commit fa1629d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion com32/menu/menumain.c
Expand Up @@ -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 */
Expand Down

0 comments on commit fa1629d

Please sign in to comment.