diff --git a/gb.gtk/src/cpaint_impl.cpp b/gb.gtk/src/cpaint_impl.cpp index c1dcf07ee..38cd2bdf9 100644 --- a/gb.gtk/src/cpaint_impl.cpp +++ b/gb.gtk/src/cpaint_impl.cpp @@ -991,13 +991,18 @@ static void draw_text(GB_PAINT *d, bool rich, const char *text, int len, float w if (rich) { html = gt_html_to_pango_string(text, len, false); - pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); + pango_layout_set_text(layout, "", 0); pango_layout_set_markup(layout, html, -1); + pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); if (w > 0) pango_layout_set_width(layout, (int)(w * PANGO_SCALE)); } else + { + pango_layout_set_markup(layout, "", 0); pango_layout_set_text(layout, text, len); + pango_layout_set_width(layout, -1); + } if (align == GB_DRAW_ALIGN_DEFAULT) align = ALIGN_TOP_NORMAL; @@ -1014,7 +1019,7 @@ static void draw_text(GB_PAINT *d, bool rich, const char *text, int len, float w offy = -(EXTRA(d)->ascent); } - cairo_rel_move_to(CONTEXT(d), offx + DX(d), offy + DY(d)); + cairo_rel_move_to(CONTEXT(d), offx, offy); if (draw) pango_cairo_show_layout(CONTEXT(d), layout); else