aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-19 00:26:07 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-19 00:26:07 -0400
commit10c6ece6f1a57bc10f57e28fc8b92db3fd177de7 (patch)
tree41071bbb9f671ba06869bb905b95f9a8ef2a3805
parent4ee6445e6abd50823505a818272f0328aa436eac (diff)
downloadrunes-10c6ece6f1a57bc10f57e28fc8b92db3fd177de7.tar.gz
runes-10c6ece6f1a57bc10f57e28fc8b92db3fd177de7.zip
need to clear two cells before drawing a wide character
-rw-r--r--display.c14
1 files 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);
}