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
This commit is contained in:
Aaron J. Seigo 2008-04-15 12:54:17 +00:00
parent b4dd43913a
commit 2726b01a2b

View file

@ -20,6 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "trackmouse.h"
#include <QTime>
#include <kwinconfig.h>
#include <kglobal.h>
@ -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 );
}