1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-03 04:23:42 -05:00

Small fix with spaces not being rendered.

This commit is contained in:
QC 2014-05-18 18:14:15 +02:00
parent ce3165f6b0
commit cbc51910bc

View file

@ -255,11 +255,19 @@ void textbox_draw ( textbox *tb )
abort();
}
// Trailing spaces are ignored, so fix this.
// Previous version replaced all spaces, this seems to be incorrect.
for( int j = strlen(line)-1; j >= 0 && line[j] == ' '; j--) {
line[j] = '_';
}
// calc cursor position
XftTextExtentsUtf8 ( display, tb->font, ( unsigned char * ) line, cursor_offset, &extents );
// Add a small 2px offset between cursor and last glyph.
cursor_x = extents.width+2;
cursor_x = extents.width;
// We known size it good, no need for double check.
sprintf(line, "%s %s", prompt, text);
}
else
{