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
This commit is contained in:
parent
4e04b678af
commit
89458622c7
1 changed files with 3 additions and 3 deletions
|
@ -58,6 +58,8 @@ CoverSwitchEffect::CoverSwitchEffect()
|
||||||
animateStart = conf.readEntry( "AnimateStart", true );
|
animateStart = conf.readEntry( "AnimateStart", true );
|
||||||
animateStop = conf.readEntry( "AnimateStop", true );
|
animateStop = conf.readEntry( "AnimateStop", true );
|
||||||
reflection = conf.readEntry( "Reflection", true );
|
reflection = conf.readEntry( "Reflection", true );
|
||||||
|
timeLine.setCurveShape( TimeLine::EaseInOutCurve );
|
||||||
|
timeLine.setDuration( animationDuration );
|
||||||
}
|
}
|
||||||
|
|
||||||
CoverSwitchEffect::~CoverSwitchEffect()
|
CoverSwitchEffect::~CoverSwitchEffect()
|
||||||
|
@ -71,9 +73,7 @@ void CoverSwitchEffect::prePaintScreen( ScreenPrePaintData& data, int time )
|
||||||
data.mask |= Effect::PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS;
|
data.mask |= Effect::PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS;
|
||||||
if( animation || start || stop )
|
if( animation || start || stop )
|
||||||
{
|
{
|
||||||
double progress = qMin( 1.0, timeLine.value() + time / double( animationDuration ));
|
timeLine.addTime( (double)time );
|
||||||
timeLine.setProgress(progress);
|
|
||||||
timeLine.setCurveShape(TimeLine::EaseInOutCurve);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
effects->prePaintScreen(data, time);
|
effects->prePaintScreen(data, time);
|
||||||
|
|
Loading…
Reference in a new issue