mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
fixed editor popups shown outside the screen
This commit is contained in:
parent
7325bdac42
commit
bd02c2043e
|
@ -20,6 +20,10 @@ static int g_UiNumPopups = 0;
|
|||
void CEditor::UiInvokePopupMenu(void *Id, int Flags, float x, float y, float w, float h, int (*pfnFunc)(CEditor *pEditor, CUIRect Rect), void *pExtra)
|
||||
{
|
||||
dbg_msg("", "invoked");
|
||||
if(x + w > UI()->Screen()->w)
|
||||
x -= w;
|
||||
if(y + h > UI()->Screen()->h)
|
||||
y -= h;
|
||||
s_UiPopups[g_UiNumPopups].m_pId = Id;
|
||||
s_UiPopups[g_UiNumPopups].m_IsMenu = Flags;
|
||||
s_UiPopups[g_UiNumPopups].m_Rect.x = x;
|
||||
|
|
Loading…
Reference in a new issue