1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-05 02:39:41 +01:00

Tweak IME selection background left bound

Just extending the selection background left by one pixel so there's
not one pixel of black background to the left of a selection that
starts at the beginning of the text, and so some characters being
selected show up better (particularly where there's a long vertical bar
at the first pixel). We shouldn't be overlapping any part of the
previous character, since every character normally has a pixel of
spacing on the right.
This commit is contained in:
Dav999 2024-08-07 02:25:27 +02:00 committed by Misa Elizabeth Kai
parent 9ec8d8b637
commit 149f5fbebc

View file

@ -67,8 +67,12 @@ void ime_render(void)
SDL_memcpy(in_sel, sel_start_ptr, in_sel_nbytes);
in_sel[in_sel_nbytes] = '\0';
int before_sel_pixels = font::len(PR_FONT_LEVEL, before_sel);
int before_sel_pixels = font::len(PR_FONT_LEVEL, before_sel) - 1;
int in_sel_pixels = font::len(PR_FONT_LEVEL, in_sel);
if (in_sel_pixels > 0)
{
in_sel_pixels += 1;
}
SDL_Rect selrect = imebox;
selrect.x += before_sel_pixels + 1;