mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
fixed clipping in the server browser. closes #1818
This commit is contained in:
parent
0e9b8aa220
commit
a05e40f96a
|
@ -604,7 +604,13 @@ int CMenus::DoBrowserEntry(const void *pID, CUIRect View, const CServerInfo *pEn
|
||||||
View.VSplitLeft(160.0f, &Info, &View);
|
View.VSplitLeft(160.0f, &Info, &View);
|
||||||
RenderDetailInfo(Info, pEntry);
|
RenderDetailInfo(Info, pEntry);
|
||||||
|
|
||||||
|
CUIRect NewClipArea = *UI()->ClipArea();
|
||||||
|
CUIRect OldClipArea = NewClipArea;
|
||||||
|
NewClipArea.x = View.x;
|
||||||
|
NewClipArea.w = View.w;
|
||||||
|
UI()->ClipEnable(&NewClipArea);
|
||||||
RenderDetailScoreboard(View, pEntry, 4);
|
RenderDetailScoreboard(View, pEntry, 4);
|
||||||
|
UI()->ClipEnable(&OldClipArea);
|
||||||
|
|
||||||
if(ReturnValue && UI()->MouseInside(&View))
|
if(ReturnValue && UI()->MouseInside(&View))
|
||||||
ReturnValue++;
|
ReturnValue++;
|
||||||
|
@ -1952,8 +1958,6 @@ void CMenus::RenderDetailScoreboard(CUIRect View, const CServerInfo *pInfo, int
|
||||||
|
|
||||||
CUIRect Scroll;
|
CUIRect Scroll;
|
||||||
|
|
||||||
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;
|
float LineHeight = 20.0f;
|
||||||
|
|
||||||
|
@ -2091,8 +2095,6 @@ void CMenus::RenderDetailScoreboard(CUIRect View, const CServerInfo *pInfo, int
|
||||||
|
|
||||||
++Count;
|
++Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
UI()->ClipDisable();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2114,7 +2116,9 @@ void CMenus::RenderServerbrowserServerDetail(CUIRect View, const CServerInfo *pI
|
||||||
//RenderTools()->DrawUIRect(&View, vec4(0, 0, 0, 0.15f), CUI::CORNER_B, 4.0f);
|
//RenderTools()->DrawUIRect(&View, vec4(0, 0, 0, 0.15f), CUI::CORNER_B, 4.0f);
|
||||||
ServerHeader.HMargin(2.0f, &ServerHeader);
|
ServerHeader.HMargin(2.0f, &ServerHeader);
|
||||||
UI()->DoLabelScaled(&ServerHeader, Localize("Scoreboard"), FontSize + 2.0f, CUI::ALIGN_CENTER);
|
UI()->DoLabelScaled(&ServerHeader, Localize("Scoreboard"), FontSize + 2.0f, CUI::ALIGN_CENTER);
|
||||||
|
UI()->ClipEnable(&ServerScoreboard);
|
||||||
RenderDetailScoreboard(ServerScoreboard, pInfo, 0);
|
RenderDetailScoreboard(ServerScoreboard, pInfo, 0);
|
||||||
|
UI()->ClipDisable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMenus::FriendlistOnUpdate()
|
void CMenus::FriendlistOnUpdate()
|
||||||
|
|
|
@ -110,6 +110,7 @@ public:
|
||||||
float PixelSize();
|
float PixelSize();
|
||||||
void ClipEnable(const CUIRect *pRect);
|
void ClipEnable(const CUIRect *pRect);
|
||||||
void ClipDisable();
|
void ClipDisable();
|
||||||
|
const CUIRect *ClipArea() const { return &m_ClipRect; };
|
||||||
|
|
||||||
// TODO: Refactor: Redo UI scaling
|
// TODO: Refactor: Redo UI scaling
|
||||||
float Scale() const;
|
float Scale() const;
|
||||||
|
|
Loading…
Reference in a new issue