Merge pull request #2007 from Dune-jr/fix-scorehud-id

Fix missing GetClientIdRectSize in textwidth computation for score hud
This commit is contained in:
oy 2019-01-31 20:51:41 +01:00 committed by GitHub
commit 0b642df946
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -292,7 +292,7 @@ void CHud::RenderScoreHud()
int ID = aPlayerInfo[t].m_ClientID; int ID = aPlayerInfo[t].m_ClientID;
char aName[64]; char aName[64];
str_format(aName, sizeof(aName), "%s", g_Config.m_ClShowsocial ? m_pClient->m_aClients[ID].m_aName : ""); str_format(aName, sizeof(aName), "%s", g_Config.m_ClShowsocial ? m_pClient->m_aClients[ID].m_aName : "");
float w = TextRender()->TextWidth(0, 8.0f, aName, -1); float w = TextRender()->TextWidth(0, 8.0f, aName, -1) + RenderTools()->GetClientIdRectSize(8.0f);
CTextCursor Cursor; CTextCursor Cursor;
float x = min(Whole-w-1.0f, Whole-ScoreWidthMax-ImageSize-2*Split-PosSize); float x = min(Whole-w-1.0f, Whole-ScoreWidthMax-ImageSize-2*Split-PosSize);