mirror of https://github.com/davatorium/rofi.git
Fix #443
This commit is contained in:
parent
f066290c8a
commit
b5595d7a7e
|
@ -299,6 +299,9 @@ static void texbox_update ( textbox *tb )
|
||||||
PangoRectangle pos;
|
PangoRectangle pos;
|
||||||
int cursor_offset = 0;
|
int cursor_offset = 0;
|
||||||
cursor_offset = MIN ( tb->cursor, text_len );
|
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 );
|
pango_layout_get_cursor_pos ( tb->layout, cursor_offset, &pos, NULL );
|
||||||
// Add a small 4px offset between cursor and last glyph.
|
// Add a small 4px offset between cursor and last glyph.
|
||||||
cursor_x = pos.x / PANGO_SCALE;
|
cursor_x = pos.x / PANGO_SCALE;
|
||||||
|
|
Loading…
Reference in New Issue