From afb1279b214561f7cfa0ef19a1ebefc24e437ce9 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 3 Feb 2010 12:46:54 +0000 Subject: [PATCH] center the pixmaps in the first anim frame too svn path=/trunk/KDE/kdelibs/; revision=1084667 --- animations/pixmaptransition.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/animations/pixmaptransition.cpp b/animations/pixmaptransition.cpp index 4d7841201..1955a3502 100644 --- a/animations/pixmaptransition.cpp +++ b/animations/pixmaptransition.cpp @@ -41,13 +41,14 @@ PixmapTransition::~PixmapTransition() void PixmapTransition::setStartPixmap(const QPixmap &pixmap) { - if (state() != Running) { - m_startPixmap = pixmap; - m_currentPixmap = pixmap; - } else { - m_startPixmap = m_currentPixmap; + if (state() == Running) { stop(); } + + m_startPixmap = pixmap; + + //this will center the pixmaps if needed + updateCurrentTime(0); } QPixmap PixmapTransition::startPixmap() const @@ -57,7 +58,13 @@ QPixmap PixmapTransition::startPixmap() const void PixmapTransition::setTargetPixmap(const QPixmap &pixmap) { + if (state() == Running) { + stop(); + } + m_targetPixmap = pixmap; + + updateCurrentTime(0); } QPixmap PixmapTransition::targetPixmap() const