diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2009-01-06 22:43:06 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-01-06 22:43:06 +0100 |
commit | d3eced6c5078ff7330383ee9317ac4f37389ac69 (patch) | |
tree | 2b6d7ea7ae938c457746cdf52a02354cec9c5b37 /src | |
parent | cf0b8753dadbcc6484b859a21544e437ef7d33eb (diff) | |
download | mana-d3eced6c5078ff7330383ee9317ac4f37389ac69.tar.gz mana-d3eced6c5078ff7330383ee9317ac4f37389ac69.tar.bz2 mana-d3eced6c5078ff7330383ee9317ac4f37389ac69.tar.xz mana-d3eced6c5078ff7330383ee9317ac4f37389ac69.zip |
Fix wrapping of UTF-8 multi-byte characters.
(cherry picked from commit 82182aeb9eacb3a6e10e34b34b46ef63222ecd7d)
Diffstat (limited to 'src')
-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 80e41fc2..2706a4c4 100644 --- a/src/gui/browserbox.cpp +++ b/src/gui/browserbox.cpp @@ -392,7 +392,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()); |