From a181ba9bbf319447db83eea6ce243a08425bb4f4 Mon Sep 17 00:00:00 2001 From: Oleg Kosmakov Date: Tue, 25 Mar 2014 22:56:40 +0200 Subject: Fixes #271 --- src/graphics/engine/text.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/graphics/engine/text.cpp') diff --git a/src/graphics/engine/text.cpp b/src/graphics/engine/text.cpp index 581ff01..d0c9cc8 100644 --- a/src/graphics/engine/text.cpp +++ b/src/graphics/engine/text.cpp @@ -646,7 +646,13 @@ void CText::DrawString(const std::string &text, std::vector::itera DrawCharAndAdjustPos(ch, font, size, pos, color); - fmtIndex++; + // increment fmtIndex for each byte in multibyte character + if ( ch.c1 != 0 ) + fmtIndex++; + if ( ch.c2 != 0 ) + fmtIndex++; + if ( ch.c3 != 0 ) + fmtIndex++; } if (eol != 0) -- cgit v1.2.3-1-g7c22