ensure frameInterval isn't zero, prevents div-by-zero

BUG:190218

svn path=/trunk/KDE/kdelibs/; revision=957201
This commit is contained in:
Aaron J. Seigo 2009-04-21 15:19:43 +00:00
parent 04a722f05b
commit 6804f6fe65

View File

@ -379,7 +379,7 @@ int Animator::customAnimation(int frames, int duration, Animator::CurveShape cur
state->frames = frames;
state->currentFrame = 0;
state->curve = curve;
state->frameInterval = duration / qreal(state->frames);
state->frameInterval = qMax(qreal(1.0), duration / qreal(state->frames));
state->interval = qMax(MIN_TICK_RATE_INT, state->frameInterval - (state->frameInterval % MIN_TICK_RATE_INT));
state->currentInterval = state->interval;
state->receiver = receiver;