mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Let CUI::Screen
return a const
pointer
Callers should never modify the UI screen.
This commit is contained in:
parent
b4c114450c
commit
72775f236b
|
@ -2431,7 +2431,7 @@ void CMenus::OnRender()
|
|||
ms_ColorTabbarHoverIngame = ColorRGBA(1, 1, 1, 0.75f);
|
||||
|
||||
// update the ui
|
||||
CUIRect *pScreen = UI()->Screen();
|
||||
const CUIRect *pScreen = UI()->Screen();
|
||||
float mx = (m_MousePos.x / (float)Graphics()->WindowWidth()) * pScreen->w;
|
||||
float my = (m_MousePos.y / (float)Graphics()->WindowHeight()) * pScreen->h;
|
||||
|
||||
|
|
|
@ -2263,7 +2263,7 @@ ColorHSLA CMenus::RenderHSLColorPicker(const CUIRect *pRect, unsigned int *pColo
|
|||
return HSLColor;
|
||||
}
|
||||
|
||||
CUIRect *pScreen = UI()->Screen();
|
||||
const CUIRect *pScreen = UI()->Screen();
|
||||
ms_ColorPicker.m_X = minimum(UI()->MouseX(), pScreen->w - ms_ColorPicker.ms_Width);
|
||||
ms_ColorPicker.m_Y = minimum(UI()->MouseY(), pScreen->h - ms_ColorPicker.ms_Height);
|
||||
ms_ColorPicker.m_pColor = pColor;
|
||||
|
|
|
@ -80,7 +80,7 @@ void CTooltips::OnRender()
|
|||
Rect.w = TextRender()->TextWidth(14.0f, Tooltip.m_pText, -1, -1.0f) + 4.0f;
|
||||
Rect.h = 30.0f;
|
||||
|
||||
CUIRect *pScreen = UI()->Screen();
|
||||
const CUIRect *pScreen = UI()->Screen();
|
||||
|
||||
// Try the top side.
|
||||
if(Tooltip.m_Rect.y - Rect.h - MARGIN > pScreen->y)
|
||||
|
|
|
@ -294,7 +294,7 @@ float CUI::ButtonColorMul(const void *pID)
|
|||
return ButtonColorMulDefault();
|
||||
}
|
||||
|
||||
CUIRect *CUI::Screen()
|
||||
const CUIRect *CUI::Screen()
|
||||
{
|
||||
float Aspect = Graphics()->ScreenAspect();
|
||||
float w, h;
|
||||
|
|
|
@ -331,7 +331,7 @@ public:
|
|||
float ButtonColorMulDefault() { return 1.0f; }
|
||||
float ButtonColorMul(const void *pID);
|
||||
|
||||
CUIRect *Screen();
|
||||
const CUIRect *Screen();
|
||||
void MapScreen();
|
||||
float PixelSize();
|
||||
|
||||
|
|
Loading…
Reference in a new issue