Fix bubbles when used with RTL language

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7742 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-02-20 20:44:46 +00:00
parent f73a476814
commit 749d63cfec

View File

@ -72,11 +72,23 @@ void BubbleWidget::add()
m_expanded_size.LowerRightCorner.Y += additionalNeededSize/2 + 10;
// reduce text to fit in the available space if it's too long
while (text_height > m_shrinked_size.getHeight())
if (translations->isRTLLanguage())
{
message = message.subString(0, message.size() - 10) + "...";
irrwidget->setText(message.c_str());
text_height = irrwidget->getTextHeight();
while (text_height > m_shrinked_size.getHeight() && message.size() > 10)
{
message = core::stringw(L"...") + message.subString(10, message.size() - 10);
irrwidget->setText(message.c_str());
text_height = irrwidget->getTextHeight();
}
}
else
{
while (text_height > m_shrinked_size.getHeight() && message.size() > 10)
{
message = message.subString(0, message.size() - 10) + "...";
irrwidget->setText(message.c_str());
text_height = irrwidget->getTextHeight();
}
}
}
m_shrinked_text = message;