From 65ee24a2a33b8657298680f10c9e1207cea14bfc Mon Sep 17 00:00:00 2001 From: Igor Trindade Oliveira Date: Wed, 24 Feb 2010 08:53:10 +0000 Subject: [PATCH] use qfuzzycompare to resolse black frame in pixmap transitions svn path=/trunk/KDE/kdelibs/; revision=1095410 --- animations/pixmaptransition.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/animations/pixmaptransition.cpp b/animations/pixmaptransition.cpp index 174c4feb1..43db51a69 100644 --- a/animations/pixmaptransition.cpp +++ b/animations/pixmaptransition.cpp @@ -144,16 +144,19 @@ void PixmapTransition::updateCurrentTime(int currentTime) if (m_currentPixmap.isNull()) { m_currentPixmap = QPixmap(m_targetPixmap.size()); } - m_currentPixmap.fill(QColor(0, 0, 0, (int)(((qreal)255)*qMin((qreal)0.98, delta)))); + m_currentPixmap.fill(QColor(0, 0, 0, (int)(((qreal)255)*delta))); QPainter p(&m_currentPixmap); p.setCompositionMode(QPainter::CompositionMode_SourceIn); p.drawPixmap(m_currentPixmap.rect(), m_targetPixmap, m_targetPixmap.rect()); p.end(); } else if (m_targetPixmap.isNull()) { m_currentPixmap = m_startPixmap; + if (qFuzzyCompare(delta, qreal(1.0))) { + return; + } QPainter p(&m_currentPixmap); p.setCompositionMode(QPainter::CompositionMode_DestinationIn); - p.fillRect(m_currentPixmap.rect(), QColor(0, 0, 0, (int)(((qreal)255)*qMin((qreal)0.98, delta)))); + p.fillRect(m_currentPixmap.rect(), QColor(0, 0, 0, (int)(((qreal)255)*delta))); p.end(); } }