From d98775df4f62732e87c6f7a54527abcf1bfcf766 Mon Sep 17 00:00:00 2001 From: ouv Date: Mon, 19 Feb 2007 14:06:46 +0000 Subject: [PATCH] GLViewPort2d fit all operation is called after the correct GLWidget resizing. --- src/GLViewer/GLViewer_ViewPort2d.h | 1 + src/GLViewer/GLViewer_Widget.cxx | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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.; -- 2.39.2