diff options
| author | Leyla Farazha <leyla@lindenlab.com> | 2009-07-15 01:12:51 +0000 | 
|---|---|---|
| committer | Leyla Farazha <leyla@lindenlab.com> | 2009-07-15 01:12:51 +0000 | 
| commit | 7cdaba233244746ccfe40cb8e5542ac63fc1927f (patch) | |
| tree | 15aec2d7410f00fc16dbaf24c250b84d8955ff16 /indra | |
| parent | 83a6ea234f32bf30d1f16b276d128debb2aeea02 (diff) | |
Fixing DEV-35175 regression.
Context Windows will now spawn up if too far down, and spawn left if too far right.
reviewed by James
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/llui/llmenugl.cpp | 28 | 
1 files changed, 23 insertions, 5 deletions
| diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index d24eb1ec56..4ef4bf996c 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3589,12 +3589,30 @@ void LLContextMenu::show(S32 x, S32 y)  	const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getMenuRect();  	LLView* parent_view = getParent(); -	if(getParentMenuItem()) +	// Open upwards if menu extends past bottom +	if (y - height < menu_region_rect.mBottom)  	{ -		S32 parent_width = getParentMenuItem()->getRect().getWidth(); -		 -		if(x + width > menu_region_rect.getWidth()) -			x -= parent_width + width; +		if (getParentMenuItem()) // Adjust if this is a submenu +		{ +			y += height - getParentMenuItem()->getNominalHeight();		 +		} +		else +		{ +			y += height; +		} +	} + +	// Open out to the left if menu extends past right edge +	if (x + width > menu_region_rect.mRight) +	{ +		if (getParentMenuItem()) +		{ +			x -= getParentMenuItem()->getRect().getWidth() + width; +		} +		else +		{ +			x -= width; +		}  	}  	S32 local_x, local_y; | 
