From 9f780167276bfece9bbc29c0321fd41500bd0c9c Mon Sep 17 00:00:00 2001 From: rkrolib Date: Sun, 26 Oct 2003 05:59:15 +0000 Subject: [PATCH] Added John's text-positioning modification. The lines that he was altering were very oddly-split, so while I was at it, I repaired the line-break damage. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@243 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/freeglut_menu.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/freeglut/freeglut/src/freeglut_menu.c b/freeglut/freeglut/src/freeglut_menu.c index a0b544c..f9d5f68 100644 --- a/freeglut/freeglut/src/freeglut_menu.c +++ b/freeglut/freeglut/src/freeglut_menu.c @@ -215,13 +215,12 @@ static GLboolean fghCheckMenuStatus( SFG_Window* window, SFG_Menu* menu ) menuEntry->SubMenu->X = menu->X + menu->Width ; menuEntry->SubMenu->Y = menu->Y + menuEntry->Ordinal * FREEGLUT_MENU_HEIGHT ; - if ( menuEntry->SubMenu->X + menuEntry->SubMenu->Width > glutGet ( -GLUT_SCREEN_WIDTH ) ) - menuEntry->SubMenu->X = menu->X - menuEntry->SubMenu->Width ; + if ( menuEntry->SubMenu->X + menuEntry->SubMenu->Width > glutGet (GLUT_SCREEN_WIDTH ) ) + menuEntry->SubMenu->X = menu->X - menuEntry->SubMenu->Width; - if ( menuEntry->SubMenu->Y + menuEntry->SubMenu->Height > glutGet ( -GLUT_SCREEN_HEIGHT ) ) - menuEntry->SubMenu->Y -=menuEntry->SubMenu->Height ; + if ( menuEntry->SubMenu->Y + menuEntry->SubMenu->Height > glutGet (GLUT_SCREEN_HEIGHT ) ) + menuEntry->SubMenu->Y -= (menuEntry->SubMenu->Height - + FREEGLUT_MENU_HEIGHT - 2*FREEGLUT_MENU_BORDER); fgSetWindow ( menuEntry->SubMenu->Window ) ; glutPositionWindow ( menuEntry->SubMenu->X, menuEntry->SubMenu->Y ) ;