Skip to content
Snippets Groups Projects
Commit c3e97f64 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 04e3bb9a
Branches
Tags
No related merge requests found
...@@ -2740,8 +2740,6 @@ void showbuf(uifc_winmode_t mode, int left, int top, int width, int height, cons ...@@ -2740,8 +2740,6 @@ void showbuf(uifc_winmode_t mode, int left, int top, int width, int height, cons
_setcursortype(_NOCURSOR); _setcursortype(_NOCURSOR);
title_len=strlen(title); title_len=strlen(title);
if(api->mode&UIFC_MOUSE)
title_len+=6;
if((unsigned)(top+height)>=api->scrn_len) if((unsigned)(top+height)>=api->scrn_len)
height = api->scrn_len - top; height = api->scrn_len - top;
...@@ -2788,7 +2786,7 @@ void showbuf(uifc_winmode_t mode, int left, int top, int width, int height, cons ...@@ -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++) for(i=0; i<width*height; i++)
set_vmem(&tmp_buffer2[i], ' ', api->hclr|(api->bclr<<4), 0); set_vmem(&tmp_buffer2[i], ' ', api->hclr|(api->bclr<<4), 0);
tmp_buffer2[0].ch=api->chars->help_top_left; 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) { if(j>width-6) {
j=width-6; j=width-6;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment