Skip to content

Commit

Permalink
Use new getLastDrawNode() function.
Browse files Browse the repository at this point in the history
Previously, if nothing was selected, the last item on the drawlist would
always be selected because the check of scrpos would never match. It
should have been "< bottomDrawLine - 1". Now it should correctly select
the last item on the screen.

Signed-off-by: Mike Beattie <mike@ethernal.org>
  • Loading branch information
mjbnz committed Dec 7, 2019
1 parent 0af6ff8 commit 2f8e176
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -1782,11 +1782,8 @@ void checkSelected()

dn = getSelectedDrawNode();
if (!dn) {
dl = g_list_first(drawlist);
while (dl && (((DrawNode *) dl->data)->scrpos < bottomDrawLine))
dl = g_list_next(dl);
if (!dl) dl = g_list_last(drawlist);
setEntryActiveStatus((DrawNode *) dl->data, TRUE);
dn = getLastDrawNode();
setEntryActiveStatus(dn, TRUE);
return;
}
if (dn -> scrpos == 0 || dn -> scrpos > bottomDrawLine) {
Expand Down

0 comments on commit 2f8e176

Please sign in to comment.