Use Margin instead of both VMargin and HMargin

This commit is contained in:
Robert Müller 2022-04-30 23:58:14 +02:00
parent e291a3a70c
commit a1614e4709
3 changed files with 6 additions and 14 deletions

View file

@ -1603,10 +1603,7 @@ int CMenus::Render()
CUIRect Box, Part;
Box = Screen;
if(m_Popup != POPUP_FIRST_LAUNCH)
{
Box.VMargin(150.0f / UI()->Scale(), &Box);
Box.HMargin(150.0f / UI()->Scale(), &Box);
}
Box.Margin(150.0f / UI()->Scale(), &Box);
// render the box
RenderTools()->DrawUIRect(&Box, BgColor, CUI::CORNER_ALL, 15.0f);
@ -1750,8 +1747,7 @@ int CMenus::Render()
else if(m_Popup == POPUP_CONNECTING)
{
Box = Screen;
Box.VMargin(150.0f, &Box);
Box.HMargin(150.0f, &Box);
Box.Margin(150.0f, &Box);
Box.HSplitBottom(20.f, &Box, &Part);
Box.HSplitBottom(24.f, &Box, &Part);
Part.VMargin(120.0f, &Part);
@ -1817,8 +1813,7 @@ int CMenus::Render()
else if(m_Popup == POPUP_LANGUAGE)
{
Box = Screen;
Box.VMargin(150.0f, &Box);
Box.HMargin(150.0f, &Box);
Box.Margin(150.0f, &Box);
Box.HSplitTop(20.f, &Part, &Box);
Box.HSplitBottom(20.f, &Box, &Part);
Box.HSplitBottom(24.f, &Box, &Part);
@ -1834,8 +1829,7 @@ int CMenus::Render()
else if(m_Popup == POPUP_COUNTRY)
{
Box = Screen;
Box.VMargin(150.0f, &Box);
Box.HMargin(150.0f, &Box);
Box.Margin(150.0f, &Box);
Box.HSplitTop(20.f, &Part, &Box);
Box.HSplitBottom(20.f, &Box, &Part);
Box.HSplitBottom(24.f, &Box, &Part);

View file

@ -80,8 +80,7 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
CUIRect Screen = *UI()->Screen();
CUIRect Box, Part, Part2;
Box = Screen;
Box.VMargin(150.0f / UI()->Scale(), &Box);
Box.HMargin(150.0f / UI()->Scale(), &Box);
Box.Margin(150.0f / UI()->Scale(), &Box);
// render the box
RenderTools()->DrawUIRect(&Box, ColorRGBA(0, 0, 0, 0.5f), CUI::CORNER_ALL, 15.0f);

View file

@ -451,8 +451,7 @@ bool CUIEx::DoEditBox(const void *pID, const CUIRect *pRect, char *pStr, unsigne
CUIRect Textbox = *pRect;
RenderTools()->DrawUIRect(&Textbox, ColorRGBA(1, 1, 1, 0.5f), Corners, 3.0f);
Textbox.VMargin(2.0f, &Textbox);
Textbox.HMargin(2.0f, &Textbox);
Textbox.Margin(2.0f, &Textbox);
const char *pDisplayStr = pStr;
char aStars[128];