diff options
-rw-r--r-- | src/gui/widgets/extendedlistbox.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp index 0363b73a0..721a0a591 100644 --- a/src/gui/widgets/extendedlistbox.cpp +++ b/src/gui/widgets/extendedlistbox.cpp @@ -89,9 +89,12 @@ void ExtendedListBox::draw(gcn::Graphics *graphics) if (insideWidth < strWidth) { const int strSize = str.size(); + int divPos = strSize / 2; + if (divPos > 0 && (unsigned char)str[divPos - 1] >= 0xc0) + divPos --; list.push_back(ExtendedListBoxItem(row, - str.substr(0, strSize / 2), useImage, y)); - str = str.substr(strSize / 2); + str.substr(0, divPos), useImage, y)); + str = str.substr(divPos); y += height; useImage = false; } |