Adding Takeshi Nishimura's Feature Request "[ 1045202 ] Cope with a menu with many items" -- sorry it took so long.

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@719 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
fayjf 2007-09-18 03:22:11 +00:00
parent 179cf69128
commit 4433f7f336

View File

@ -263,9 +263,13 @@ static GLboolean fghCheckMenuStatus( SFG_Menu* menu )
menuEntry->SubMenu->X = menu->X - menuEntry->SubMenu->Width; menuEntry->SubMenu->X = menu->X - menuEntry->SubMenu->Width;
if( menuEntry->SubMenu->Y + menuEntry->SubMenu->Height > max_y ) if( menuEntry->SubMenu->Y + menuEntry->SubMenu->Height > max_y )
{
menuEntry->SubMenu->Y -= ( menuEntry->SubMenu->Height - menuEntry->SubMenu->Y -= ( menuEntry->SubMenu->Height -
FREEGLUT_MENU_HEIGHT - FREEGLUT_MENU_HEIGHT -
2 * FREEGLUT_MENU_BORDER ); 2 * FREEGLUT_MENU_BORDER );
if( menuEntry->SubMenu->Y < 0 )
menuEntry->SubMenu->Y = 0;
}
fgSetWindow( menuEntry->SubMenu->Window ); fgSetWindow( menuEntry->SubMenu->Window );
glutPositionWindow( menuEntry->SubMenu->X, glutPositionWindow( menuEntry->SubMenu->X,
@ -552,7 +556,11 @@ static void fghActivateMenu( SFG_Window* window, int button )
menu->X -=menu->Width; menu->X -=menu->Width;
if( menu->Y + menu->Height > max_y ) if( menu->Y + menu->Height > max_y )
{
menu->Y -=menu->Height; menu->Y -=menu->Height;
if( menu->Y < 0 )
menu->Y = 0;
}
menu->Window->State.MouseX = menu->Window->State.MouseX =
window->State.MouseX + glutGet( GLUT_WINDOW_X ) - menu->X; window->State.MouseX + glutGet( GLUT_WINDOW_X ) - menu->X;