From 10c6ece6f1a57bc10f57e28fc8b92db3fd177de7 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 19 Apr 2014 00:26:07 -0400 Subject: need to clear two cells before drawing a wide character --- display.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/display.c b/display.c index 959e2ad..ebc4e22 100644 --- a/display.c +++ b/display.c @@ -186,16 +186,9 @@ void runes_display_show_string_utf8(RunesTerm *t, char *buf, size_t len) size_t cluster_len; char width = 1; - runes_display_paint_rectangle( - t, t->cr, t->bgcolor, t->col, t->row, 1, 1); - startpos = g_utf8_offset_to_pointer(buf, pos); cluster_len = g_utf8_offset_to_pointer(buf, i) - startpos; - pango_layout_set_text(t->layout, startpos, cluster_len); - pango_cairo_update_layout(t->cr, t->layout); - pango_cairo_show_layout(t->cr, t->layout); - for (c = startpos; (size_t)(c - startpos) < cluster_len; c = g_utf8_next_char(c)) { @@ -204,6 +197,13 @@ void runes_display_show_string_utf8(RunesTerm *t, char *buf, size_t len) } } + runes_display_paint_rectangle( + t, t->cr, t->bgcolor, t->col, t->row, width, 1); + + pango_layout_set_text(t->layout, startpos, cluster_len); + pango_cairo_update_layout(t->cr, t->layout); + pango_cairo_show_layout(t->cr, t->layout); + if (t->col + width >= t->cols) { runes_display_move_to(t, t->row + 1, 0); } -- cgit v1.2.3-54-g00ecf