turn floating point constants into qreal's when passing them to qMin or qMax.

found when testing the new Krazy plugin for checking this condition.


svn path=/trunk/KDE/kdelibs/; revision=1171729
This commit is contained in:
Allen Winter 2010-09-04 23:07:23 +00:00
parent 3383a999c8
commit 91f76a12f3
2 changed files with 4 additions and 4 deletions

View File

@ -256,7 +256,7 @@ int Animator::animateItem(QGraphicsItem *item, Animation animation)
state->item = item;
state->animation = animation;
state->curve = d->driver->animationCurve(animation);
state->frames = qMax(1.0, frames * (duration / 1000.0));
state->frames = qMax(qreal(1.0), frames * (duration / 1000.0));
state->currentFrame = 0;
state->interval = d->driver->animationDuration(animation) / qreal(state->frames);
state->interval = qMax(MIN_TICK_RATE_INT, state->interval - (state->interval % MIN_TICK_RATE_INT));
@ -311,7 +311,7 @@ int Animator::moveItem(QGraphicsItem *item, Movement movement, const QPoint &des
state->movement = movement;
state->curve = d->driver->movementAnimationCurve(movement);
int duration = d->driver->movementAnimationDuration(movement);
state->frames = qMax(1.0, frames * (duration / 1000.0));
state->frames = qMax(qreal(1.0), frames * (duration / 1000.0));
state->currentFrame = 0;
state->interval = duration / qreal(state->frames);
state->interval = qMax(MIN_TICK_RATE_INT, state->interval - (state->interval % MIN_TICK_RATE_INT));
@ -437,7 +437,7 @@ int Animator::animateElement(QGraphicsItem *item, Animation animation)
state->item = item;
state->curve = d->driver->elementAnimationCurve(animation);
state->animation = animation;
state->frames = qMax(1.0, frames * (duration / 1000.0));
state->frames = qMax(qreal(1.0), frames * (duration / 1000.0));
state->currentFrame = 0;
state->interval = duration / qreal(state->frames);
state->interval = qMax(MIN_TICK_RATE_INT, state->interval - (state->interval % MIN_TICK_RATE_INT));

View File

@ -236,7 +236,7 @@ void AppletHandle::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
//kDebug() << "opaquePoint" << opaquePoint
// << m_background->marginSize(LeftMargin) << m_decorationRect.width();
g.setColorAt(0.0, Qt::transparent);
g.setColorAt(qMax(0.0, opaquePoint - 0.05), Qt::transparent);
g.setColorAt(qMax(qreal(0.0), opaquePoint - 0.05), Qt::transparent);
g.setColorAt(opaquePoint, transparencyColor);
g.setColorAt(1.0, transparencyColor);
} else {