Skip to content
Snippets Groups Projects
Commit 3d0618d0 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix centering of the showbuf (e.g. help screen) title

I'm not sure what was going on with this addition of 6 when mouse is enabled (and didn't check for WIN_DYN flag set!), but is wrong. And we need to add 4 to the title_len when figuring out the centered-offset.
parent 166e81b9
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -2740,8 +2740,6 @@ void showbuf(uifc_winmode_t mode, int left, int top, int width, int height, cons
_setcursortype(_NOCURSOR);
title_len=strlen(title);
if(api->mode&UIFC_MOUSE)
title_len+=6;
if((unsigned)(top+height)>=api->scrn_len)
height = api->scrn_len - top;
......@@ -2788,7 +2786,7 @@ void showbuf(uifc_winmode_t mode, int left, int top, int width, int height, cons
for(i=0; i<width*height; i++)
set_vmem(&tmp_buffer2[i], ' ', api->hclr|(api->bclr<<4), 0);
tmp_buffer2[0].ch=api->chars->help_top_left;
j=title_len;
j=title_len + 4; // Account for title breaks and spaces
if(j>width-6) {
j=width-6;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment