fixes for platforms where qreal is not a double
btw, wouldn't it be cleaner if all those qMin(0.0, qMax(1.0, foo)) calls are calls to qBound instead? svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=748283
This commit is contained in:
parent
8fcf61c9b6
commit
a7dcbb5456
@ -220,9 +220,9 @@ void LayoutAnimator::moveEffectUpdateItem( qreal value , LayoutItem* item , Effe
|
||||
Widget* widget = dynamic_cast<Widget*>(item->graphicsItem());
|
||||
|
||||
if ( widget && effect == FadeInMoveEffect )
|
||||
widget->setOpacity( qMin(1.0,widget->opacity()+d->delta(value)) );
|
||||
widget->setOpacity( qMin(qreal(1.0),widget->opacity()+d->delta(value)) );
|
||||
else if ( widget && effect == FadeOutMoveEffect )
|
||||
widget->setOpacity( qMax(0.0,widget->opacity()-d->delta(value)) );
|
||||
widget->setOpacity( qMax(qreal(0.0),widget->opacity()-d->delta(value)) );
|
||||
|
||||
|
||||
if ( effect == FadeInMoveEffect ) {
|
||||
|
@ -141,8 +141,8 @@ public:
|
||||
// not do anything smarter concerning the sizeHint when there are
|
||||
// autosized elements.
|
||||
|
||||
qreal width = item->sizeHint().width() / qMin(scaled.width(), 1.0);
|
||||
qreal height = item->sizeHint().height() / qMin(scaled.height(), 1.0);
|
||||
qreal width = item->sizeHint().width() / qMin(scaled.width(), qreal(1.0));
|
||||
qreal height = item->sizeHint().height() / qMin(scaled.height(), qreal(1.0));
|
||||
|
||||
if (width > sizeHint.width()) sizeHint.setWidth(width);
|
||||
if (height > sizeHint.height()) sizeHint.setHeight(height);
|
||||
|
@ -115,7 +115,7 @@ class Phase::Private
|
||||
{
|
||||
qreal progress = frames;
|
||||
progress = currentFrame / progress;
|
||||
progress = qMin(1.0, qMax(0.0, progress));
|
||||
progress = qMin(qreal(1.0), qMax(qreal(0.0), progress));
|
||||
return progress;
|
||||
}
|
||||
|
||||
@ -420,7 +420,7 @@ QPixmap Phase::animationResult(AnimId id)
|
||||
qreal progress = state->frames;
|
||||
//kDebug() << "Phase::animationResult(" << id << " at " << progress;
|
||||
progress = state->currentFrame / progress;
|
||||
progress = qMin(1.0, qMax(0.0, progress));
|
||||
progress = qMin(qreal(1.0), qMax(qreal(0.0), progress));
|
||||
//kDebug() << "Phase::animationResult(" << id << " at " << progress;
|
||||
|
||||
switch (state->animation) {
|
||||
|
@ -92,7 +92,7 @@ QString SearchMatch::searchTerm() const
|
||||
|
||||
void SearchMatch::setRelevance(qreal relevance)
|
||||
{
|
||||
d->relevance = qMax(0.0, qMin(1.0, relevance));
|
||||
d->relevance = qMax(qreal(0.0), qMin(qreal(1.0), relevance));
|
||||
}
|
||||
|
||||
qreal SearchMatch::relevance() const
|
||||
|
@ -255,7 +255,7 @@ void SignalPlotter::scale(qreal delta)
|
||||
calculateNiceRange();
|
||||
}
|
||||
|
||||
double SignalPlotter::scaledBy() const
|
||||
qreal SignalPlotter::scaledBy() const
|
||||
{
|
||||
return d->scaledBy;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user