Cube keeps rotating when mouse is at left or right screen edge.

BUG: 182454

svn path=/trunk/KDE/kdebase/workspace/; revision=930054
This commit is contained in:
Martin Gräßlin 2009-02-22 15:57:26 +00:00
parent baa3d7a1a5
commit b428fb46a0

View file

@ -2062,6 +2062,13 @@ void CubeEffect::mouseChanged( const QPoint& pos, const QPoint& oldpos, Qt::Mous
// display width corresponds to sum of angles of the polyhedron
int deltaX = oldpos.x() - pos.x();
float deltaDegrees = (float)deltaX/rect.width() * 360.0f;
if( deltaX == 0 )
{
if( pos.x() == 0 )
deltaDegrees = 5.0f;
if( pos.x() == displayWidth() -1 )
deltaDegrees = -5.0f;
}
if( invertMouse )
manualAngle += deltaDegrees;
else