Fix text display with RTL

This commit is contained in:
Benau 2019-06-14 01:45:21 +08:00
parent ec97bc8316
commit 84fa4ecac8
2 changed files with 10 additions and 5 deletions

View File

@ -885,10 +885,13 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
if (info.m_text.size() > 0)
{
core::rect<s32> pos(x+ICON_PLAYER_WIDTH, y+5,
x+ICON_PLAYER_WIDTH, y+5);
core::dimension2du dim = font->getDimension(info.m_text.c_str());
core::rect<s32> pos(x + ICON_PLAYER_WIDTH, y + 5,
x + ICON_PLAYER_WIDTH + dim.Width, y + 5 + dim.Height);
if (info.m_outlined_font)
{
GUIEngine::getOutlineFont()->draw(info.m_text, pos,
info.m_color, false, false, NULL, true/*ignore RTL*/);
}
@ -905,8 +908,10 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
if (info.special_title.size() > 0)
{
core::rect<s32> pos(x+ICON_PLAYER_WIDTH, y+5,
x+ICON_PLAYER_WIDTH, y+5);
core::dimension2du dim = font->getDimension(info.special_title.c_str());
core::rect<s32> pos(x + ICON_PLAYER_WIDTH, y + 5,
x + ICON_PLAYER_WIDTH + dim.Width, y + 5 + dim.Height);
core::stringw s(info.special_title.c_str());
font->setBlackBorder(true);
font->setThinBorder(true);

View File

@ -1183,7 +1183,7 @@ void RaceResultGUI::displayCTFResults()
// -------------
core::recti pos_name(current_x, y,
UserConfigParams::m_width, y + m_distance_between_rows);
current_x + m_width_kart_name, y + m_distance_between_rows);
m_font->draw(ri->m_kart_name, pos_name, color, false, false, NULL,
true /* ignoreRTL */);
current_x += m_width_kart_name + m_width_column_space;