mirror of https://github.com/davatorium/rofi.git
Fix small miss-drawing
This commit is contained in:
parent
3ebd0d9001
commit
08da286931
|
@ -255,21 +255,11 @@ void textbox_draw ( textbox *tb )
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
// replace spaces so XftTextExtents8 includes their width
|
|
||||||
for ( int i = 0; i < length; i++ )
|
|
||||||
{
|
|
||||||
if ( isspace ( line[i] ) )
|
|
||||||
{
|
|
||||||
line[i] = '_';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// calc cursor position
|
// calc cursor position
|
||||||
XftTextExtentsUtf8 ( display, tb->font, ( unsigned char * ) line, cursor_offset, &extents );
|
XftTextExtentsUtf8 ( display, tb->font, ( unsigned char * ) line, cursor_offset, &extents );
|
||||||
cursor_x = extents.width;
|
// Add a small 2px offset between cursor and last glyph.
|
||||||
|
cursor_x = extents.width+2;
|
||||||
// restore correct text string with spaces
|
|
||||||
sprintf ( line, "%s %s", prompt, text );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue