At least set an interval of 1 or it sometimes crashes with division by zero

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=735966
This commit is contained in:
Andre Duffeck 2007-11-13 06:29:46 +00:00
parent a9673b0ac7
commit e59c8c7241

View File

@ -317,6 +317,7 @@ Phase::AnimId Phase::customAnimation(int frames, int duration, Phase::CurveShape
state->currentFrame = 0;
state->curve = curve;
state->interval = duration / qreal(state->frames);
state->interval = qMax( 1, state->interval );
state->interval = (state->interval / MIN_TICK_RATE) * MIN_TICK_RATE;
state->currentInterval = state->interval;
state->receiver = receiver;