]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix pb with processing viewer operations in GLViewer
authorvsr <vsr@opencascade.com>
Thu, 16 Oct 2014 11:43:05 +0000 (15:43 +0400)
committervsr <vsr@opencascade.com>
Thu, 16 Oct 2014 11:43:05 +0000 (15:43 +0400)
src/GLViewer/GLViewer_Viewer.cxx

index 60efe28ee7c06aebd36c69b004b0881f403ea2f8..3d59798ee1e62ed1e52cd7b7c933c02850b4ad2e 100644 (file)
@@ -654,10 +654,13 @@ bool GLViewer_ViewTransformer::eventFilter( QObject* o, QEvent* e )
             TransformState state = EnTrain;
             QMouseEvent* me = ( QMouseEvent* )e;
 
-            myButtonState = me->modifiers();
+            myButtonState = me->buttons();
             if ( e->type() == QEvent::MouseButtonPress )
                 myButtonState |= me->button();  /* add pressed button */
 
+            if ( e->type() == QEvent::MouseButtonRelease )
+                myButtonState |= me->button();  /* add release button */
+
             int mouseOnlyState = ( myButtonState & ( Qt::LeftButton | Qt::MidButton | Qt::RightButton ) );
             if ( myStart.isNull() )
             {
@@ -666,7 +669,7 @@ bool GLViewer_ViewTransformer::eventFilter( QObject* o, QEvent* e )
                 myMajorBtn = mouseOnlyState;
             }
 
-            if ( e->type() == QEvent::MouseButtonRelease && mouseOnlyState == myMajorBtn )
+            if ( e->type() == QEvent::MouseButtonRelease )
             {
                 state = Fin;
             }
@@ -832,7 +835,7 @@ bool GLViewer_ViewSketcher::eventFilter( QObject* o, QEvent* e )
             SketchState state = EnTrain;
             QMouseEvent* me = (QMouseEvent*)e;
 
-            myButtonState = me->modifiers();
+            myButtonState = me->buttons();
             if ( e->type() == QEvent::MouseButtonPress )
                 myButtonState |= me->button();  /* add pressed button */