浏览代码

LibGfx: Make Painter::draw_text() interpret StringView as UTF-8

Andreas Kling 4 年之前
父节点
当前提交
9af33e2e4b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Libraries/LibGfx/Painter.cpp

+ 1 - 1
Libraries/LibGfx/Painter.cpp

@@ -1068,7 +1068,7 @@ void Painter::draw_text(const IntRect& rect, const Utf32View& text, TextAlignmen
 void Painter::draw_text(const IntRect& rect, const StringView& raw_text, const Font& font, TextAlignment alignment, Color color, TextElision elision)
 void Painter::draw_text(const IntRect& rect, const StringView& raw_text, const Font& font, TextAlignment alignment, Color color, TextElision elision)
 {
 {
     Utf8View text { raw_text };
     Utf8View text { raw_text };
-    do_draw_text(rect, text, font, alignment, elision, [&](const IntRect& r, u32 code_point) {
+    do_draw_text(rect, Utf8View(text), font, alignment, elision, [&](const IntRect& r, u32 code_point) {
         draw_glyph_or_emoji(r.location(), code_point, font, color);
         draw_glyph_or_emoji(r.location(), code_point, font, color);
     });
     });
 }
 }