HI Mikhail, I have just review the change and not happy with just disabling the GraphicsContext::resizedImplementation(..) as this would mean that the size the windowing has for the window will be out of sync with the size that the OSG has recorded for it, if applications query the size they'd get an erroneous value.
A solution needs to be one that handles the potential divide by zero elegantly. One of the challenges will be what happens once the zero becomes non zero once more - we need to preserve the sizes/aspect ratios of the camera(s) and viewports. Once possible workaround might be to set the Traits sizes to the values passed in to the resizedImplementation(..) but not reset the Camera viewport and projection matrices. This ideal either. I do also wonder whether we'd need some kind of window value status, because a zero size window isn't something that you can render to. Robert. On 7 July 2014 14:24, Mikhail Matrosov <[email protected]> wrote: > When viewer width or height is equal to zero, division by zero occurs > in GraphicsContext::resizedImplementation(). It breaks camera projection > matrix and the scene is not drawn. > > Many people have already experienced this issue when viewer is added as > QWidget to QTabWidget or QMdiArea. See > http://forum.openscenegraph.org/viewtopic.php?t=7239 > > In the attached GraphicsContext.cpp file call to > GraphicsContext::resizedImplementation() is ignored in the case any > dimension is equal to zero. This fixes the issue for me. > > Base version of OSG is 3.2.1, published in stable releases. > > ----- > Best regards, Mikhail Matrosov > > _______________________________________________ > osg-submissions mailing list > [email protected] > > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > >
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
