From 2726b01a2b8718dbaa80c033a6458a01eeaa2958 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 15 Apr 2008 12:54:17 +0000 Subject: [PATCH] don't start at 0 degrees every time the mouse is pressed, but base the angle on the time. this allows one to press the keyboard, let go and press it again without it jumping. svn path=/trunk/KDE/kdebase/workspace/; revision=797314 --- effects/trackmouse.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/effects/trackmouse.cpp b/effects/trackmouse.cpp index 25fef5cf34..1d3573d05b 100644 --- a/effects/trackmouse.cpp +++ b/effects/trackmouse.cpp @@ -20,6 +20,8 @@ along with this program. If not, see . #include "trackmouse.h" +#include + #include #include @@ -55,8 +57,10 @@ TrackMouseEffect::~TrackMouseEffect() void TrackMouseEffect::prePaintScreen( ScreenPrePaintData& data, int time ) { - if( active ) - angle = ( angle + time / 10 ) % 360; + if( active ) { + QTime t = QTime::currentTime(); + angle = ((t.second() % 4) * 90.0) + (t.msec() / 1000.0 * 90.0); + } effects->prePaintScreen( data, time ); }