Fixed error for when screen width * 0.75 is greater than screen height

for compute of window size when coming from fullscreen when 'f' key is pushed.
This commit is contained in:
Don BURNS 2004-08-23 20:29:42 +00:00
parent 360de7f15b
commit 3326454650

View File

@ -783,9 +783,19 @@ bool ViewerEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActio
{
unsigned int screenWidth;
unsigned int screenHeight;
unsigned int windowWidth;
unsigned int windowHeight;
rs->getScreenSize( screenWidth, screenHeight );
unsigned int windowWidth = (unsigned int)((float)screenWidth * 0.625);
unsigned int windowHeight = (unsigned int)((float)windowWidth * 0.75);
if( screenHeight > screenWidth )
{
windowWidth = (unsigned int)((float)screenWidth * 0.625);
windowHeight = (unsigned int)((float)windowWidth * 0.75);
}
else
{
windowHeight = (unsigned int)((float)screenHeight * 0.625);
windowWidth = (unsigned int)((float)windowHeight * 1.334);
}
int x = (screenWidth - windowWidth) >> 1;
int y = (screenHeight - windowHeight) >> 1;
#ifndef WIN32