From 89458622c71093b159cf37579eda99b8d9035153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 21 Apr 2008 16:09:11 +0000 Subject: [PATCH] Make physic based animation also work with "high" animation durations. Use of addTime() instead of setProgress(). Only set curve shape once. svn path=/trunk/KDE/kdebase/workspace/; revision=799466 --- effects/coverswitch.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/effects/coverswitch.cpp b/effects/coverswitch.cpp index 01cd001214..2f21b251f8 100644 --- a/effects/coverswitch.cpp +++ b/effects/coverswitch.cpp @@ -58,6 +58,8 @@ CoverSwitchEffect::CoverSwitchEffect() animateStart = conf.readEntry( "AnimateStart", true ); animateStop = conf.readEntry( "AnimateStop", true ); reflection = conf.readEntry( "Reflection", true ); + timeLine.setCurveShape( TimeLine::EaseInOutCurve ); + timeLine.setDuration( animationDuration ); } CoverSwitchEffect::~CoverSwitchEffect() @@ -71,9 +73,7 @@ void CoverSwitchEffect::prePaintScreen( ScreenPrePaintData& data, int time ) data.mask |= Effect::PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS; if( animation || start || stop ) { - double progress = qMin( 1.0, timeLine.value() + time / double( animationDuration )); - timeLine.setProgress(progress); - timeLine.setCurveShape(TimeLine::EaseInOutCurve); + timeLine.addTime( (double)time ); } } effects->prePaintScreen(data, time);