mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Fix item height when there is a scrollbar
This commit is contained in:
parent
46faf532dd
commit
760ed1163d
|
@ -1947,7 +1947,6 @@ void CMenus::RenderDetailScoreboard(CUIRect View, const CServerInfo *pInfo, int
|
||||||
|
|
||||||
if(pInfo)
|
if(pInfo)
|
||||||
{
|
{
|
||||||
CUIRect Row = View;
|
|
||||||
int Count = 0;
|
int Count = 0;
|
||||||
|
|
||||||
CUIRect Scroll;
|
CUIRect Scroll;
|
||||||
|
@ -1955,6 +1954,7 @@ void CMenus::RenderDetailScoreboard(CUIRect View, const CServerInfo *pInfo, int
|
||||||
UI()->ClipEnable(&View);
|
UI()->ClipEnable(&View);
|
||||||
|
|
||||||
float RowWidth = (RowCount == 0) ? View.w : (View.w * 0.25f);
|
float RowWidth = (RowCount == 0) ? View.w : (View.w * 0.25f);
|
||||||
|
float LineHeight = 20.0f;
|
||||||
|
|
||||||
if(RowCount == 0)
|
if(RowCount == 0)
|
||||||
{
|
{
|
||||||
|
@ -1986,9 +1986,12 @@ void CMenus::RenderDetailScoreboard(CUIRect View, const CServerInfo *pInfo, int
|
||||||
Scroll.VMargin(5.0f, &Scroll);
|
Scroll.VMargin(5.0f, &Scroll);
|
||||||
s_ScrollValue = DoScrollbarH(&s_ScrollValue, &Scroll, s_ScrollValue);
|
s_ScrollValue = DoScrollbarH(&s_ScrollValue, &Scroll, s_ScrollValue);
|
||||||
View.x += (View.w - Width) * s_ScrollValue;
|
View.x += (View.w - Width) * s_ScrollValue;
|
||||||
|
LineHeight = 0.25f*View.h;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CUIRect Row = View;
|
||||||
|
|
||||||
for(int i = 0; i < pInfo->m_NumClients; i++)
|
for(int i = 0; i < pInfo->m_NumClients; i++)
|
||||||
{
|
{
|
||||||
if((FilterInfo.m_SortHash&IServerBrowser::FILTER_BOTS) && (pInfo->m_aClients[i].m_PlayerType&CServerInfo::CClient::PLAYERFLAG_BOT))
|
if((FilterInfo.m_SortHash&IServerBrowser::FILTER_BOTS) && (pInfo->m_aClients[i].m_PlayerType&CServerInfo::CClient::PLAYERFLAG_BOT))
|
||||||
|
@ -2002,7 +2005,7 @@ void CMenus::RenderDetailScoreboard(CUIRect View, const CServerInfo *pInfo, int
|
||||||
ActColumn++;
|
ActColumn++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Row.HSplitTop(20.0f, &Name, &Row);
|
Row.HSplitTop(LineHeight, &Name, &Row);
|
||||||
RenderTools()->DrawUIRect(&Name, vec4(1.0f, 1.0f, 1.0f, (Count % 2 + 1)*0.05f), CUI::CORNER_ALL, 4.0f);
|
RenderTools()->DrawUIRect(&Name, vec4(1.0f, 1.0f, 1.0f, (Count % 2 + 1)*0.05f), CUI::CORNER_ALL, 4.0f);
|
||||||
|
|
||||||
// friend
|
// friend
|
||||||
|
@ -2024,7 +2027,7 @@ void CMenus::RenderDetailScoreboard(CUIRect View, const CServerInfo *pInfo, int
|
||||||
Name.VSplitLeft(20.0f, &Score, &Name);
|
Name.VSplitLeft(20.0f, &Score, &Name);
|
||||||
Name.VSplitRight(2*(Name.h-8.0f), &Name, &Flag);
|
Name.VSplitRight(2*(Name.h-8.0f), &Name, &Flag);
|
||||||
Flag.HMargin(4.0f, &Flag);
|
Flag.HMargin(4.0f, &Flag);
|
||||||
Name.HSplitTop(10.0f, &Name, &Clan);
|
Name.HSplitTop(LineHeight*0.5f, &Name, &Clan);
|
||||||
|
|
||||||
// score
|
// score
|
||||||
if(!(pInfo->m_aClients[i].m_PlayerType&CServerInfo::CClient::PLAYERFLAG_SPEC))
|
if(!(pInfo->m_aClients[i].m_PlayerType&CServerInfo::CClient::PLAYERFLAG_SPEC))
|
||||||
|
|
Loading…
Reference in a new issue