From b5595d7a7ec5182ae28da162191804641aa9b37f Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sat, 13 Aug 2016 16:22:15 +0200 Subject: [PATCH] Fix #443 --- source/textbox.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/textbox.c b/source/textbox.c index 302be539..6b78b7aa 100644 --- a/source/textbox.c +++ b/source/textbox.c @@ -299,6 +299,9 @@ static void texbox_update ( textbox *tb ) PangoRectangle pos; int cursor_offset = 0; cursor_offset = MIN ( tb->cursor, text_len ); + if ( (tb->flags&TB_PASSWORD) == TB_PASSWORD ){ + cursor_offset = g_utf8_pointer_to_offset ( tb->text, tb->text+cursor_offset ); + } pango_layout_get_cursor_pos ( tb->layout, cursor_offset, &pos, NULL ); // Add a small 4px offset between cursor and last glyph. cursor_x = pos.x / PANGO_SCALE;