From: vsr Date: Wed, 1 Jun 2005 09:42:25 +0000 (+0000) Subject: Fix from OUV X-Git-Tag: T3_0_0_a1~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3768b153648a8f2bb79596e0df9406c39d9ec568;p=modules%2Fgui.git Fix from OUV --- diff --git a/src/GLViewer/GLViewer_Context.cxx b/src/GLViewer/GLViewer_Context.cxx index 4ea362dc2..2bf68f348 100644 --- a/src/GLViewer/GLViewer_Context.cxx +++ b/src/GLViewer/GLViewer_Context.cxx @@ -77,15 +77,11 @@ int GLViewer_Context::MoveTo( int xi, int yi, bool byCircle ) region.setTop( (int)(y - myTolerance) ); region.setBottom( (int)(y + myTolerance) ); - QRegion circle( (int)(x - myTolerance), (int)(y - myTolerance), - (int)(2 * myTolerance), (int)(2 * myTolerance), QRegion::Ellipse ); - for( it = myObjects.begin(); it != myObjects.end(); ++it ) { it.key()->setScale( aXScale, aYScale ); rect = it.key()->getUpdateRect()->toQRect(); obj = QRegion( *rect ); - intersection = obj.intersect( circle ); if( !byCircle && rect->intersects( region ) ) { @@ -99,13 +95,19 @@ int GLViewer_Context::MoveTo( int xi, int yi, bool byCircle ) // cout << "highlight" << endl; } - if( byCircle && !intersection.isEmpty() ) + if( byCircle ) { - update = it.key()->highlight( x, y, myTolerance, GL_TRUE ); - isHigh = it.key()->isHighlighted(); - onObject = GL_TRUE; + QRegion circle( (int)(x - myTolerance), (int)(y - myTolerance), + (int)(2 * myTolerance), (int)(2 * myTolerance), QRegion::Ellipse ); + intersection = obj.intersect( circle ); + if( !intersection.isEmpty() ) + { + update = it.key()->highlight( x, y, myTolerance, GL_TRUE ); + isHigh = it.key()->isHighlighted(); + onObject = GL_TRUE; + } } - + if( isHigh ) { lastPicked = it.key();