diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2009-01-06 22:43:06 +0100 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-06 15:14:15 -0700 |
commit | f4a0cc34922e7c94e4bc2fce80fa6ab748854e58 (patch) | |
tree | 3bfd1632a3b46da42e6d11f220b92bd2d7c6e72a /src/gui/browserbox.cpp | |
parent | 57b4d184f8c47c853ca49ffb56f99c0533c71d07 (diff) | |
download | mana-f4a0cc34922e7c94e4bc2fce80fa6ab748854e58.tar.gz mana-f4a0cc34922e7c94e4bc2fce80fa6ab748854e58.tar.bz2 mana-f4a0cc34922e7c94e4bc2fce80fa6ab748854e58.tar.xz mana-f4a0cc34922e7c94e4bc2fce80fa6ab748854e58.zip |
Fix wrapping of UTF-8 multi-byte characters.
(cherry picked from commit 82182aeb9eacb3a6e10e34b34b46ef63222ecd7d)
Diffstat (limited to 'src/gui/browserbox.cpp')
-rw-r--r-- | src/gui/browserbox.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp index ebd92e5a..8b222810 100644 --- a/src/gui/browserbox.cpp +++ b/src/gui/browserbox.cpp @@ -366,7 +366,10 @@ BrowserBox::draw(gcn::Graphics *graphics) continue; } - end--; + // Skip to the start of the current character + while ((row[end] & 192) == 128) + end--; + end--; // And then to the last byte of the previous one part = row.substr(start, end - start + 1); } while ((x + font->getWidth(part.c_str()) + 10) > getWidth()); |