From b428fb46a0d6a06a5bc02e041087f3199d86cb43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 22 Feb 2009 15:57:26 +0000 Subject: [PATCH] Cube keeps rotating when mouse is at left or right screen edge. BUG: 182454 svn path=/trunk/KDE/kdebase/workspace/; revision=930054 --- effects/cube/cube.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp index 18554b83f0..be083ce022 100644 --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -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