From: ouv Date: Mon, 19 Feb 2007 14:06:46 +0000 (+0000) Subject: GLViewPort2d fit all operation is called after the correct GLWidget resizing. X-Git-Tag: CTH_V12~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d98775df4f62732e87c6f7a54527abcf1bfcf766;p=modules%2Fgui.git GLViewPort2d fit all operation is called after the correct GLWidget resizing. --- diff --git a/src/GLViewer/GLViewer_ViewPort2d.h b/src/GLViewer/GLViewer_ViewPort2d.h index 76b59b6d4..400f9b27a 100644 --- a/src/GLViewer/GLViewer_ViewPort2d.h +++ b/src/GLViewer/GLViewer_ViewPort2d.h @@ -58,6 +58,7 @@ class QtxToolTip; class GLViewer_ViewPort2d: public GLViewer_ViewPort { Q_OBJECT + friend class GLViewer_Widget; //! Dragging states enum vpDragState{ noDrag, initDrag, inDrag }; diff --git a/src/GLViewer/GLViewer_Widget.cxx b/src/GLViewer/GLViewer_Widget.cxx index 1fc069d20..8a2df1827 100644 --- a/src/GLViewer/GLViewer_Widget.cxx +++ b/src/GLViewer/GLViewer_Widget.cxx @@ -340,15 +340,16 @@ void GLViewer_Widget::resizeGL( int w, int h ) if( w < 1 ) w = 1; glViewport( 0, 0, w, h); - if( myStart ) + myViewPort->initResize( w, h ); + + if( myStart && w > 1 && h > 1 ) { myWidth = w; myHeight = h; + myViewPort->fitAll(); myStart = GL_FALSE; } - myViewPort->initResize( w, h ); - glMatrixMode( GL_PROJECTION ); glLoadIdentity(); GLfloat w_c = w / 2., h_c = h / 2.;