From bd02c2043e9f76ec47ee9ac35caf23ae294b1dfa Mon Sep 17 00:00:00 2001 From: oy Date: Mon, 28 Jun 2010 15:12:43 +0200 Subject: [PATCH] fixed editor popups shown outside the screen --- src/game/editor/ed_popups.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game/editor/ed_popups.cpp b/src/game/editor/ed_popups.cpp index 08ec51cb6..001a7249c 100644 --- a/src/game/editor/ed_popups.cpp +++ b/src/game/editor/ed_popups.cpp @@ -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;