Salome HOME
This file is given from DESCARTES project
[modules/gui.git] / src / GLViewer / GLViewer_Viewer2d.cxx
index bbd6533e5e75b6d52c29beefcd9f92d9ec7b072b..74114b3f4af47633863b190edd7bc05d95f7b2e0 100644 (file)
@@ -1,7 +1,26 @@
+//  Copyright (C) 2005 OPEN CASCADE
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//  Author : OPEN CASCADE
+//
+
 // File:      GLViewer_Viewer2d.cxx
 // Created:   November, 2004
-// Author:    OCC team
-// Copyright (C) CEA 2004
 
 /***************************************************************************
 **  Class:   GLViewer_Viewer2d
@@ -131,7 +150,11 @@ void GLViewer_Viewer2d::updateBorders()
     for ( int i = 0, n = views.count(); i < n; i++ )
     {
         GLViewer_Rect* border = ( ( GLViewer_ViewPort2d* )((GLViewer_ViewFrame*)views[i])->getViewPort() )->getBorder();
+        if ( !border )
+          continue;
         border->setIsEmpty( true );
+        // initialise border by default values to avoid old values
+        border->setCoords( 0, 0, 0, 0 );
         for ( ObjList::Iterator it = beginIt; it != endIt; ++it )
         {
             GLViewer_Object* anObject = *it;