Following the same function convention call in the remaining classes.

TODO: check which classes it makes sense to actually allow the user
to set the easing curve.


svn path=/trunk/KDE/kdelibs/; revision=1060689
This commit is contained in:
Adenilson Cavalcanti Da Silva 2009-12-09 16:34:43 +00:00
parent 5a721b9bad
commit ca35755ac0
5 changed files with 10 additions and 10 deletions

View File

@ -78,8 +78,8 @@ void GeometryAnimation::updateCurrentTime(int currentTime)
{ {
QGraphicsWidget *w = widgetToAnimate(); QGraphicsWidget *w = widgetToAnimate();
if (w) { if (w) {
qreal delta = easingCurve().valueForProgress( qreal delta = Animation::easingCurve().valueForProgress(
currentTime / qreal(duration())); currentTime / qreal(duration()));
QRectF newGeo = m_startGeometry; QRectF newGeo = m_startGeometry;
newGeo.adjust((-m_startGeometry.x() + m_targetGeometry.x()) * delta, newGeo.adjust((-m_startGeometry.x() + m_targetGeometry.x()) * delta,

View File

@ -98,8 +98,8 @@ void PulseAnimation::updateCurrentTime(int currentTime)
{ {
QGraphicsWidget *w = under; QGraphicsWidget *w = under;
if (w) { if (w) {
qreal delta = easingCurve().valueForProgress( qreal delta = Animation::easingCurve().valueForProgress(
currentTime / qreal(duration())); currentTime / qreal(duration()));
delta = (1 - endScale) * delta; delta = (1 - endScale) * delta;
w->setScale(1 - delta); w->setScale(1 - delta);
} }

View File

@ -162,8 +162,8 @@ void RotationAnimation::updateCurrentTime(int currentTime)
{ {
QGraphicsWidget *w = widgetToAnimate(); QGraphicsWidget *w = widgetToAnimate();
if (w) { if (w) {
qreal delta = easingCurve().valueForProgress( qreal delta = Animation::easingCurve().valueForProgress(
currentTime / qreal(duration())); currentTime / qreal(duration()));
delta = angle() * delta; delta = angle() * delta;
m_rotation->setAngle(delta); m_rotation->setAngle(delta);
} }

View File

@ -150,13 +150,13 @@ void RotationStackedAnimation::updateCurrentTime(int currentTime)
if(w) { if(w) {
qreal delta; qreal delta;
if (currentTime <= duration()/2) { if (currentTime <= duration()/2) {
delta = easingCurve().valueForProgress( delta = Animation::easingCurve().valueForProgress(
(currentTime * 2) / qreal(duration())); (currentTime * 2) / qreal(duration()));
sLayout->setCurrentWidgetIndex(0); sLayout->setCurrentWidgetIndex(0);
delta = frontEndAngle * delta; delta = frontEndAngle * delta;
frontRotation->setAngle(delta); frontRotation->setAngle(delta);
} else { } else {
delta = easingCurve().valueForProgress( delta = Animation::easingCurve().valueForProgress(
(currentTime/2) / qreal(duration())); (currentTime/2) / qreal(duration()));
sLayout->setCurrentWidgetIndex(1); sLayout->setCurrentWidgetIndex(1);
delta = backEndAngle * delta; delta = backEndAngle * delta;

View File

@ -64,8 +64,8 @@ void ZoomAnimation::updateCurrentTime(int currentTime)
{ {
QGraphicsWidget *w = widgetToAnimate(); QGraphicsWidget *w = widgetToAnimate();
if (w) { if (w) {
qreal delta = easingCurve().valueForProgress( qreal delta = Animation::easingCurve().valueForProgress(
currentTime / qreal(duration())); currentTime / qreal(duration()));
delta = (1 - m_zoom) * delta; delta = (1 - m_zoom) * delta;
w->setScale( 1 - delta); w->setScale( 1 - delta);
} }