From Paul de Repentigny, fix for dvide by zero crash under windows when toggle full screen in ogviewer.
From Robert Osfield, tweak to the fix to add comment describing the extra check, and addition of check against width, and change to ==0 rather than <= 0.
This commit is contained in:
@@ -208,6 +208,10 @@ void ViewerEventHandler::StatsAndHelpDrawCallback::operator()( const Producer::C
|
||||
int x,y;
|
||||
unsigned int width,height;
|
||||
camera.getProjectionRectangle(x,y,width,height);
|
||||
|
||||
// don't redraw if the new window size is 0 width or height.
|
||||
if (width==0 || height==0) return;
|
||||
|
||||
_viewport->setViewport(x,y,width,height);
|
||||
|
||||
OsgSceneHandler* osh = _veh->getOsgCameraGroup()->getSceneHandlerList()[_cameraNumber].get();
|
||||
@@ -1258,13 +1262,6 @@ bool ViewerEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActio
|
||||
|
||||
}
|
||||
|
||||
#ifdef COMPILE_COMPOSITE_EVENTHANDLER
|
||||
void ViewerEventHandler::accept(osgGA::GUIEventHandlerVisitor& gehv)
|
||||
{
|
||||
gehv.visit(*this);
|
||||
}
|
||||
#endif
|
||||
|
||||
void ViewerEventHandler::getUsage(osg::ApplicationUsage& usage) const
|
||||
{
|
||||
usage.addKeyboardMouseBinding("f","Toggle fullscreen");
|
||||
|
||||
Reference in New Issue
Block a user