summaryrefslogtreecommitdiff
path: root/indra/llui/llmenugl.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2014-12-19 09:14:53 -0500
committerOz Linden <oz@lindenlab.com>2014-12-19 09:14:53 -0500
commit9c56eb9eadc08aaf939759f4991fc8f201289a13 (patch)
tree19dbf730addfdaa4cbeba2b5c7491cc1db61c7c6 /indra/llui/llmenugl.cpp
parentbf2e3fca73b80afa10a1c913ba752fcaf79ccd19 (diff)
parent4ec9bce3c2a715f53938e4568c95b7a2bdfc9e16 (diff)
merge changes for 3.7.23
Diffstat (limited to 'indra/llui/llmenugl.cpp')
-rwxr-xr-xindra/llui/llmenugl.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 604dc92789..d3ed4a1286 100755
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -1276,7 +1276,15 @@ void LLMenuItemBranchGL::openMenu()
{
// open upwards if menu extends past bottom
// adjust by the height of the menu item branch since it is a submenu
- delta_y = branch_rect.getHeight() - getRect().getHeight();
+ if (y + 2 * branch_rect.getHeight() - getRect().getHeight() > menu_region_rect.mTop)
+ {
+ // overlaps with top border, align with top
+ delta_y = menu_region_rect.mTop - y - branch_rect.getHeight();
+ }
+ else
+ {
+ delta_y = branch_rect.getHeight() - getRect().getHeight();
+ }
}
if( x + branch_rect.getWidth() > menu_region_rect.mRight )
@@ -3258,6 +3266,11 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
CURSOR_WIDTH + MOUSE_CURSOR_PADDING * 2,
CURSOR_HEIGHT + MOUSE_CURSOR_PADDING * 2);
menu->translateIntoRectWithExclusion( menu_region_rect, mouse_rect );
+ if (menu->getRect().mTop > menu_region_rect.mTop)
+ {
+ // not enough space: align with top, ignore exclusion
+ menu->translateIntoRect( menu_region_rect );
+ }
menu->getParent()->sendChildToFront(menu);
}