From 8e6dbb949229b9950d239ddcee825db4d3c8d09c Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 16 Oct 2014 15:43:05 +0400 Subject: [PATCH] Fix pb with processing viewer operations in GLViewer --- src/GLViewer/GLViewer_Viewer.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/GLViewer/GLViewer_Viewer.cxx b/src/GLViewer/GLViewer_Viewer.cxx index 60efe28ee..3d59798ee 100644 --- a/src/GLViewer/GLViewer_Viewer.cxx +++ b/src/GLViewer/GLViewer_Viewer.cxx @@ -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 */ -- 2.39.2