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

BUG: 182454

svn path=/trunk/KDE/kdebase/workspace/; revision=930054
icc-effect-5.14.5
Martin Gräßlin 2009-02-22 15:57:26 +00:00
parent baa3d7a1a5
commit b428fb46a0
1 changed files with 7 additions and 0 deletions

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