- limit the number of left/right rotations. Cube will not rotate endless if cursor keys are being pressed

- fix vertical mouse movement

svn path=/trunk/KDE/kdebase/workspace/; revision=848624
This commit is contained in:
Martin Gräßlin 2008-08-18 09:39:48 +00:00
parent a09f473662
commit d5be0f8da5

View file

@ -1341,6 +1341,7 @@ void CubeEffect::grabbedKeyboardEvent( QKeyEvent* e )
} }
else else
{ {
if( rotations.count() < effects->numberOfDesktops() )
rotations.enqueue( Left ); rotations.enqueue( Left );
} }
break; break;
@ -1354,6 +1355,7 @@ void CubeEffect::grabbedKeyboardEvent( QKeyEvent* e )
} }
else else
{ {
if( rotations.count() < effects->numberOfDesktops() )
rotations.enqueue( Right ); rotations.enqueue( Right );
} }
break; break;
@ -1551,7 +1553,7 @@ void CubeEffect::mouseChanged( const QPoint& pos, const QPoint& oldpos, Qt::Mous
if( !verticalRotating ) if( !verticalRotating )
{ {
// display height corresponds to 180* // display height corresponds to 180*
int deltaY = oldpos.y() - pos.y(); int deltaY = pos.y() - oldpos.y();
float deltaVerticalDegrees = (float)deltaY/rect.height()*180.0f; float deltaVerticalDegrees = (float)deltaY/rect.height()*180.0f;
manualVerticalAngle -= deltaVerticalDegrees; manualVerticalAngle -= deltaVerticalDegrees;
if( deltaVerticalDegrees != 0.0 ) if( deltaVerticalDegrees != 0.0 )