]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for 53877 issue rnv/53877
authorrnv <rnv@opencascade.com>
Tue, 7 Feb 2017 14:05:25 +0000 (17:05 +0300)
committerrnv <rnv@opencascade.com>
Tue, 7 Feb 2017 14:05:25 +0000 (17:05 +0300)
src/OCCViewer/OCCViewer_ViewSketcher.cxx

index 103880d525d32046e562446532140f8b50ccf95e..16d028f1d787bfbdf1ae8cb0b3eb4e5ef95218c2 100755 (executable)
@@ -492,35 +492,30 @@ void OCCViewer_PolygonSketcher::onSketch( SketchState state )
     if ( state != Fin )
       p.drawPolyline( *mypPoints );
       }*/
-  if ( mypPolyRB )
-    {
+  if ( mypPolyRB ) {
+    if ( state == Fin ) {
+      mypPolyRB->clearGeometry();
+      mypPolyRB->hide();
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+      QApplication::syncX();
+#endif
+      mypViewWindow->activateSketching( OCCViewer_ViewWindow::NoSketching );
+    } else {
       mypPolyRB->setUpdatesEnabled ( false );
       if ( !mypPolyRB->isVisible() )
-        mypPolyRB->show();
+       mypPolyRB->show();
       //if ( state != Debut )
       //  mypPolyRB->repaint();
-
+      
       if ( state != Fin && points->count() )
-        mypPolyRB->initGeometry( QPolygon(*points) << myCurr );
+       mypPolyRB->initGeometry( QPolygon(*points) << myCurr );
       //mypPolyRB->addNode( myCurr );
-
+      
       //if ( state != Fin )
       //  mypPolyRB->repaint();
       mypPolyRB->setUpdatesEnabled ( true );
       //mypPolyRB->repaint();
     }
-      
-  if ( state == Fin )
-  {
-    if ( mypPolyRB )
-      {
-        mypPolyRB->clearGeometry();
-        mypPolyRB->hide();
-      }
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-    QApplication::syncX();
-#endif
-    mypViewWindow->activateSketching( OCCViewer_ViewWindow::NoSketching );
   }
 }