diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-04-19 00:26:07 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-04-19 00:26:07 -0400 |
commit | 10c6ece6f1a57bc10f57e28fc8b92db3fd177de7 (patch) | |
tree | 41071bbb9f671ba06869bb905b95f9a8ef2a3805 | |
parent | 4ee6445e6abd50823505a818272f0328aa436eac (diff) | |
download | runes-10c6ece6f1a57bc10f57e28fc8b92db3fd177de7.tar.gz runes-10c6ece6f1a57bc10f57e28fc8b92db3fd177de7.zip |
need to clear two cells before drawing a wide character
-rw-r--r-- | display.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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); } |