From: sln Date: Fri, 7 Dec 2007 11:07:17 +0000 (+0000) Subject: Problem with starting pooling when rectangular selection is performed X-Git-Tag: CTH_V1_3~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=394b0424d613ff8a7bc8daf6fa8fecaee5046a61;p=modules%2Fgui.git Problem with starting pooling when rectangular selection is performed --- diff --git a/src/GLViewer/GLViewer_ViewPort2d.cxx b/src/GLViewer/GLViewer_ViewPort2d.cxx index 0fc004d7d..be0007a55 100644 --- a/src/GLViewer/GLViewer_ViewPort2d.cxx +++ b/src/GLViewer/GLViewer_ViewPort2d.cxx @@ -1188,6 +1188,14 @@ void GLViewer_ViewPort2d::drawSelectByRect( int x, int y ) } +/*! + Returns tue if selection by rect is preformed +*/ +bool GLViewer_ViewPort2d::isSelectByRect() const +{ + return mypFirstPoint && mypLastPoint; +} + /*! Finishes rectangle selection */ diff --git a/src/GLViewer/GLViewer_ViewPort2d.h b/src/GLViewer/GLViewer_ViewPort2d.h index 4d4581f52..95326f360 100644 --- a/src/GLViewer/GLViewer_ViewPort2d.h +++ b/src/GLViewer/GLViewer_ViewPort2d.h @@ -140,6 +140,9 @@ public: void drawSelectByRect( int x, int y ); //! Pass rect into selector and update void finishSelectByRect(); + + //! Pass rect into selector and update + bool isSelectByRect() const; //! \warnign It is for ouv bool startPulling( GLViewer_Pnt ); diff --git a/src/GLViewer/GLViewer_Viewer2d.cxx b/src/GLViewer/GLViewer_Viewer2d.cxx index 962d2e03f..fbbb7b7d3 100644 --- a/src/GLViewer/GLViewer_Viewer2d.cxx +++ b/src/GLViewer/GLViewer_Viewer2d.cxx @@ -938,11 +938,12 @@ void GLViewer_Viewer2d::startOperations( QMouseEvent* e ) transPoint( x, y ); GLViewer_Pnt point( x, y ); - if( e->button() == Qt::LeftButton && vp->startPulling( point ) ) - return; + // moved to updateOperations() - see below + //if( e->button() == Qt::LeftButton && vp->startPulling( point ) ) + // return; if( e->button() == Qt::LeftButton && !(vp->currentBlock() & BS_Selection) && !myGLContext->getCurrentObject() ) - vp->startSelectByRect( e->x(), e->y() ); + vp->startSelectByRect( e->x(), e->y() ); } /*! @@ -965,13 +966,16 @@ bool GLViewer_Viewer2d::updateOperations( QMouseEvent* e ) } /*if( vp->isDragProcess() == GLViewer_ViewPort2d::inDrag ) - return true; + return true;*/ - if( e->state() == Qt::LeftButton && vp->startPulling( point ) ) + if( e->state() == Qt::LeftButton ) { - vp->finishSelectByRect(); + if ( !vp->isSelectByRect() && vp->startPulling( point ) ) + { + vp->finishSelectByRect(); //startSelectByRect return true; - }*/ + } + } if( !myGLContext->getCurrentObject() ) {