From 33a37c0a82426349bce9150be9a91e1beba46d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net> Date: Fri, 29 Jan 2021 04:03:58 -0500 Subject: [PATCH] Ok, that last one was wrong... sue me. So here's what we're doing now... we set bar so that the first item shown in the menu is the lowest index possible that still shows cur. bar is therefore calculated as the displayed item count minus the distance from cur to the end of the list. Yeah, that's the easiest way to explain it. --- src/sbbs3/js_uifc.c | 1 + src/uifc/uifc32.c | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sbbs3/js_uifc.c b/src/sbbs3/js_uifc.c index 1b69e35806..73859ad91d 100644 --- a/src/sbbs3/js_uifc.c +++ b/src/sbbs3/js_uifc.c @@ -44,6 +44,7 @@ struct list_ctx_private { int top; int width; }; + struct showbuf_ctx_private { int cur; int bar; diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c index 55b4599d4a..e520ed4687 100644 --- a/src/uifc/uifc32.c +++ b/src/uifc/uifc32.c @@ -931,10 +931,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar (*cur)=(*bar); i=(*cur)-(*bar); if(i+(height-vbrdrsize-1)>=opts) { - i=opts-(height-vbrdrsize); - if(i<0) - i=0; - (*cur)=i+(*bar); + (*bar)=(height-vbrdrsize)-(opts-cur); } } if((*cur)<0) -- GitLab