mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #1799
1799: Fix name/clan width when zooming out (fixes #1752) r=def- a=Jupeyy Co-authored-by: Jupeyy <jupjopjap@gmail.com>
This commit is contained in:
commit
d35550ce19
|
@ -63,8 +63,6 @@ void CNamePlates::RenderNameplate(
|
|||
mem_copy(m_aNamePlates[ClientID].m_aName, pName, sizeof(m_aNamePlates[ClientID].m_aName));
|
||||
m_aNamePlates[ClientID].m_NameTextFontSize = FontSize;
|
||||
|
||||
m_aNamePlates[ClientID].m_NameTextWidth = TextRender()->TextWidth(0, FontSize, pName, -1);
|
||||
|
||||
if(m_aNamePlates[ClientID].m_NameTextContainerIndex != -1)
|
||||
TextRender()->DeleteTextContainer(m_aNamePlates[ClientID].m_NameTextContainerIndex);
|
||||
|
||||
|
@ -76,6 +74,9 @@ void CNamePlates::RenderNameplate(
|
|||
float ScreenX0, ScreenY0, ScreenX1, ScreenY1;
|
||||
Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1);
|
||||
MapscreenToGroup(m_pClient->m_pCamera->m_Center.x, m_pClient->m_pCamera->m_Center.y, Layers()->GameGroup());
|
||||
|
||||
m_aNamePlates[ClientID].m_NameTextWidth = TextRender()->TextWidth(0, FontSize, pName, -1);
|
||||
|
||||
m_aNamePlates[ClientID].m_NameTextContainerIndex = TextRender()->CreateTextContainer(&Cursor, pName);
|
||||
Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1);
|
||||
}
|
||||
|
@ -88,8 +89,6 @@ void CNamePlates::RenderNameplate(
|
|||
mem_copy(m_aNamePlates[ClientID].m_aClanName, pClan, sizeof(m_aNamePlates[ClientID].m_aClanName));
|
||||
m_aNamePlates[ClientID].m_ClanNameTextFontSize = FontSizeClan;
|
||||
|
||||
m_aNamePlates[ClientID].m_ClanNameTextWidth = TextRender()->TextWidth(0, FontSizeClan, pClan, -1);
|
||||
|
||||
if(m_aNamePlates[ClientID].m_ClanNameTextContainerIndex != -1)
|
||||
TextRender()->DeleteTextContainer(m_aNamePlates[ClientID].m_ClanNameTextContainerIndex);
|
||||
|
||||
|
@ -101,6 +100,9 @@ void CNamePlates::RenderNameplate(
|
|||
float ScreenX0, ScreenY0, ScreenX1, ScreenY1;
|
||||
Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1);
|
||||
MapscreenToGroup(m_pClient->m_pCamera->m_Center.x, m_pClient->m_pCamera->m_Center.y, Layers()->GameGroup());
|
||||
|
||||
m_aNamePlates[ClientID].m_ClanNameTextWidth = TextRender()->TextWidth(0, FontSizeClan, pClan, -1);
|
||||
|
||||
m_aNamePlates[ClientID].m_ClanNameTextContainerIndex = TextRender()->CreateTextContainer(&Cursor, pClan);
|
||||
Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue