Changeset 3312

Show
Ignore:
Timestamp:
08/23/04 22:29:42 (10 years ago)
Author:
don
Message:

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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgProducer/ViewerEventHandler.cpp

    r3311 r3312  
    784784                        unsigned int screenWidth; 
    785785                        unsigned int screenHeight; 
     786                        unsigned int windowWidth; 
     787                        unsigned int windowHeight; 
    786788                        rs->getScreenSize( screenWidth, screenHeight ); 
    787                         unsigned int windowWidth  = (unsigned int)((float)screenWidth * 0.625); 
    788                         unsigned int windowHeight = (unsigned int)((float)windowWidth * 0.75); 
     789                        if( screenHeight > screenWidth ) 
     790                        { 
     791                            windowWidth  = (unsigned int)((float)screenWidth * 0.625); 
     792                            windowHeight = (unsigned int)((float)windowWidth * 0.75); 
     793                        } 
     794                        else 
     795                        { 
     796                            windowHeight = (unsigned int)((float)screenHeight * 0.625); 
     797                            windowWidth  = (unsigned int)((float)windowHeight * 1.334); 
     798                        } 
    789799                        int x = (screenWidth - windowWidth) >> 1; 
    790800                        int y = (screenHeight - windowHeight) >> 1;