summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorQball Cow <qball@gmpclient.org>2014-05-16 09:17:55 +0200
committerQball Cow <qball@gmpclient.org>2014-05-16 09:17:55 +0200
commit08da28693146a66975223d0c4501d78adf4dd428 (patch)
tree6da0ddf8c55aa301b0f488d0b06db2ac5afc31d8 /source
parent3ebd0d9001ecab3bc4264a6447fd045bcf338eff (diff)
Fix small miss-drawing
Diffstat (limited to 'source')
-rw-r--r--source/textbox.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/source/textbox.c b/source/textbox.c
index 7dc06234..bf69650e 100644
--- a/source/textbox.c
+++ b/source/textbox.c
@@ -255,21 +255,11 @@ void textbox_draw ( textbox *tb )
abort();
}
- // replace spaces so XftTextExtents8 includes their width
- for ( int i = 0; i < length; i++ )
- {
- if ( isspace ( line[i] ) )
- {
- line[i] = '_';
- }
- }
// calc cursor position
XftTextExtentsUtf8 ( display, tb->font, ( unsigned char * ) line, cursor_offset, &extents );
- cursor_x = extents.width;
-
- // restore correct text string with spaces
- sprintf ( line, "%s %s", prompt, text );
+ // Add a small 2px offset between cursor and last glyph.
+ cursor_x = extents.width+2;
}
else
{