Rescale the time font if icon is small (solve issue #4089) (#4090)

* rescale the time font if icon is small

* no need for equal
This commit is contained in:
riso 2019-10-11 00:30:45 -05:00 committed by Benau
parent edb338da88
commit 3c4479b63a

View File

@ -887,6 +887,11 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
break;
}
// If player number is large (small icon), rescale font size
int font_height = font->getDimension(L"X").Height;
if ((float)ICON_PLAYER_WIDTH*0.7f < (float)font_height)
font->setScale(0.7f*(float)ICON_PLAYER_WIDTH / (float)font_height);
if (info.m_text.size() > 0)
{
core::dimension2du dim = font->getDimension(info.m_text.c_str());
@ -924,6 +929,7 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
font->setThinBorder(false);
font->setBlackBorder(false);
}
font->setScale(1.0f);
AbstractKart* target_kart = NULL;