]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
bos #19051: EDF - selection by polygon is almost freezing the computer vsv/19051_POLYGON_SELECTION
authorvsv <vsv@opencascade.com>
Wed, 13 May 2020 09:06:59 +0000 (12:06 +0300)
committervsv <vsv@opencascade.com>
Wed, 13 May 2020 09:06:59 +0000 (12:06 +0300)
src/OCCViewer/OCCViewer_ViewSketcher.cxx
src/OCCViewer/OCCViewer_ViewWindow.cxx

index bd31ff3b30101cc56b55fbfa6bee7a8dfd73f034..6e2cbc007668cd4769e8ea0dad1b2cbd4f503de1 100644 (file)
@@ -473,7 +473,7 @@ void OCCViewer_PolygonSketcher::onMouse( QMouseEvent* e )
 
   if ( e->type() == QEvent::MouseButtonRelease && ( e->button() & sketchButton() ) )
   {
-    myResult = closed? Accept : Reject;
+    myResult = (closed && (points->count() > 2)) ? Accept : Reject;
     QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(),
                                                    e->globalPos(), e->button(), 
                                                    e->buttons(), e->modifiers() ) );
index a7a0bab06defbb336e2394f8e4384b017aebce51..da790e08159ccd07005d8ac7360d087815ae033d 100644 (file)
@@ -3178,7 +3178,7 @@ void OCCViewer_ViewWindow::onSketchingFinished()
     case Polygon:
       {
         QPolygon* aPolygon = (QPolygon*)mypSketcher->data();
-        if( aPolygon )
+        if( aPolygon && (aPolygon->size() > 2))
         {
           int size = aPolygon->size();
           TColgp_Array1OfPnt2d anArray(1, size);