update using the real frame interval to get a proper distribution across the frame range of custom animations
svn path=/trunk/KDE/kdelibs/; revision=950439
This commit is contained in:
parent
260973cd9d
commit
18211150b2
@ -85,6 +85,7 @@ struct CustomAnimationState
|
|||||||
Animator::CurveShape curve;
|
Animator::CurveShape curve;
|
||||||
int frames;
|
int frames;
|
||||||
int currentFrame;
|
int currentFrame;
|
||||||
|
int frameInterval;
|
||||||
int interval;
|
int interval;
|
||||||
int currentInterval;
|
int currentInterval;
|
||||||
int id;
|
int id;
|
||||||
@ -378,8 +379,8 @@ int Animator::customAnimation(int frames, int duration, Animator::CurveShape cur
|
|||||||
state->frames = frames;
|
state->frames = frames;
|
||||||
state->currentFrame = 0;
|
state->currentFrame = 0;
|
||||||
state->curve = curve;
|
state->curve = curve;
|
||||||
state->interval = duration / qreal(state->frames);
|
state->frameInterval = duration / qreal(state->frames);
|
||||||
state->interval = qMax(MIN_TICK_RATE_INT, state->interval - (state->interval % MIN_TICK_RATE_INT));
|
state->interval = qMax(MIN_TICK_RATE_INT, state->frameInterval - (state->frameInterval % MIN_TICK_RATE_INT));
|
||||||
state->currentInterval = state->interval;
|
state->currentInterval = state->interval;
|
||||||
state->receiver = receiver;
|
state->receiver = receiver;
|
||||||
state->slot = qstrdup(slot);
|
state->slot = qstrdup(slot);
|
||||||
@ -657,7 +658,7 @@ void Animator::timerEvent(QTimerEvent *event)
|
|||||||
// advance the frame
|
// advance the frame
|
||||||
state->currentFrame +=
|
state->currentFrame +=
|
||||||
(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects) ?
|
(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects) ?
|
||||||
qMax(1, elapsed / state->interval) : state->frames - state->currentFrame;
|
qMax(1, elapsed / state->frameInterval) : state->frames - state->currentFrame;
|
||||||
/*kDebug() << "custom anim for" << state->receiver
|
/*kDebug() << "custom anim for" << state->receiver
|
||||||
<< "to slot" << state->slot
|
<< "to slot" << state->slot
|
||||||
<< "with interval of" << state->interval
|
<< "with interval of" << state->interval
|
||||||
|
Loading…
x
Reference in New Issue
Block a user