[osg-submissions] GraphicsWindowWin32 fix to prevent resizing window height to zero

Adrian Egli 3dhelp at gmail.com
Sat Dec 8 09:56:36 PST 2007


ok, sorry,



                if (clientRect.bottom==0 || clientRect.right==0)
                {
                    //
                    // Window has been minimized or has only toolbars
visible; keep window width & height to a minimum of 1 pixel
                    //

                    windowWidth  = 1;
                    windowHeight = 1;
                }
                else
                {
                    windowWidth  = clientRect.right;
                    windowHeight = clientRect.bottom;
                }


i am not sure, but i feel we have to test against:
windowWidth  = clientRect.right == 0 ? 1 : clientRect.right ;
windowHeight = clientRect.bottom == 0 ? 1 : clientRect.bottom;

2007/12/8, Robert Osfield <robert.osfield at gmail.com>:
>
> On Dec 8, 2007 10:42 AM, Adrian Egli <3dhelp at gmail.com> wrote:
> > Hi
> >
> > i came up with short review :
> >
> > Quick fix to this is relax condition:
> > >                 if (clientRect.bottom==0 || clientRect.right==0)
> >
> > make it not more sense to prevent either bottom == 0 or/and right == 0
> size
> >
> > if ( clientRect.bottom==0 ) ...
> > if ( clientRect.right==0 ) ...
>
> O.K. you've got me confused, changing the && to || does prevent
> problems if either bottom or right equals zero, I really don't know
> what using two separate if statements would provide.
>
> Robert.
> _______________________________________________
> osg-submissions mailing list
> osg-submissions at lists.openscenegraph.org
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>



-- 
********************************************
Adrian Egli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20071208/5181ea40/attachment.html 


More information about the osg-submissions mailing list