Avoid double call for QEasingCurve's valueForProgress() (now executed by EasingAnimation before calling updateEffectiveTime), causing a minor corruption of the effective animation progress values.
svn path=/trunk/KDE/kdelibs/; revision=1117762
This commit is contained in:
parent
d54fd38d3b
commit
75b66bdd8b
@ -76,8 +76,7 @@ void FadeAnimation::updateEffectiveTime(int currentTime)
|
|||||||
QGraphicsWidget *w = targetWidget();
|
QGraphicsWidget *w = targetWidget();
|
||||||
if (w) {
|
if (w) {
|
||||||
qreal delta = currentTime / qreal(duration());
|
qreal delta = currentTime / qreal(duration());
|
||||||
delta = (m_startOpacity - m_targetOpacity) *
|
delta *= m_startOpacity - m_targetOpacity;
|
||||||
Animation::easingCurve().valueForProgress(delta);
|
|
||||||
w->setOpacity(m_startOpacity - delta);
|
w->setOpacity(m_startOpacity - delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,8 +78,7 @@ void GeometryAnimation::updateEffectiveTime(int currentTime)
|
|||||||
{
|
{
|
||||||
QGraphicsWidget *w = targetWidget();
|
QGraphicsWidget *w = targetWidget();
|
||||||
if (w) {
|
if (w) {
|
||||||
qreal delta = Animation::easingCurve().valueForProgress(
|
const qreal delta = currentTime / qreal(duration());
|
||||||
currentTime / qreal(duration()));
|
|
||||||
|
|
||||||
QRectF newGeo = m_startGeometry;
|
QRectF newGeo = m_startGeometry;
|
||||||
newGeo.adjust((-m_startGeometry.x() + m_targetGeometry.x()) * delta,
|
newGeo.adjust((-m_startGeometry.x() + m_targetGeometry.x()) * delta,
|
||||||
|
@ -44,8 +44,7 @@ void GrowAnimation::updateEffectiveTime(int currentTime)
|
|||||||
{
|
{
|
||||||
QGraphicsWidget *w = targetWidget();
|
QGraphicsWidget *w = targetWidget();
|
||||||
if (w && state() == QAbstractAnimation::Running) {
|
if (w && state() == QAbstractAnimation::Running) {
|
||||||
qreal delta = Animation::easingCurve().valueForProgress(
|
const qreal delta = currentTime / qreal(duration());
|
||||||
currentTime / qreal(duration()));
|
|
||||||
QRectF geometry;
|
QRectF geometry;
|
||||||
geometry.setTopLeft(m_startGeometry.topLeft() * (1-delta) + (m_targetGeometry.topLeft() * delta));
|
geometry.setTopLeft(m_startGeometry.topLeft() * (1-delta) + (m_targetGeometry.topLeft() * delta));
|
||||||
geometry.setSize(m_startGeometry.size() * (1-delta) + (m_targetGeometry.size() * delta));
|
geometry.setSize(m_startGeometry.size() * (1-delta) + (m_targetGeometry.size() * delta));
|
||||||
|
@ -133,7 +133,6 @@ void PixmapTransition::updateEffectiveTime(int currentTime)
|
|||||||
QGraphicsWidget *w = targetWidget();
|
QGraphicsWidget *w = targetWidget();
|
||||||
if (w) {
|
if (w) {
|
||||||
qreal delta = currentTime / qreal(duration());
|
qreal delta = currentTime / qreal(duration());
|
||||||
delta *= Animation::easingCurve().valueForProgress(delta);
|
|
||||||
if (!m_startPixmap.isNull() && !m_targetPixmap.isNull()) {
|
if (!m_startPixmap.isNull() && !m_targetPixmap.isNull()) {
|
||||||
m_currentPixmap = Plasma::PaintUtils::transition(m_startPixmap, m_targetPixmap, delta);
|
m_currentPixmap = Plasma::PaintUtils::transition(m_startPixmap, m_targetPixmap, delta);
|
||||||
} else if (m_startPixmap.isNull()) {
|
} else if (m_startPixmap.isNull()) {
|
||||||
|
@ -119,11 +119,10 @@ void PulseAnimation::updateState(QAbstractAnimation::State newState, QAbstractAn
|
|||||||
void PulseAnimation::updateEffectiveTime(int currentTime)
|
void PulseAnimation::updateEffectiveTime(int currentTime)
|
||||||
{
|
{
|
||||||
if (m_under.data()) {
|
if (m_under.data()) {
|
||||||
qreal delta = Animation::easingCurve().valueForProgress( currentTime / qreal(duration()));
|
qreal delta = currentTime / qreal(duration());
|
||||||
|
|
||||||
if (m_under.data()->isIconBigger()) {
|
if (m_under.data()->isIconBigger()) {
|
||||||
m_under.data()->setScale(delta);
|
m_under.data()->setScale(delta);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
m_under.data()->setScale(delta);
|
m_under.data()->setScale(delta);
|
||||||
delta = (1 - m_endScale) * delta;
|
delta = (1 - m_endScale) * delta;
|
||||||
|
@ -161,11 +161,8 @@ void RotationAnimation::updateState(QAbstractAnimation::State newState, QAbstrac
|
|||||||
|
|
||||||
void RotationAnimation::updateEffectiveTime(int currentTime)
|
void RotationAnimation::updateEffectiveTime(int currentTime)
|
||||||
{
|
{
|
||||||
QGraphicsWidget *w = targetWidget();
|
if (targetWidget()) {
|
||||||
if (w) {
|
qreal delta = currentTime * angle() / qreal(duration());
|
||||||
qreal delta = Animation::easingCurve().valueForProgress(
|
|
||||||
currentTime / qreal(duration()));
|
|
||||||
delta = angle() * delta;
|
|
||||||
m_rotation->setAngle(delta);
|
m_rotation->setAngle(delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,8 +72,7 @@ void SlideAnimation::updateEffectiveTime(int currentTime)
|
|||||||
{
|
{
|
||||||
QGraphicsWidget *w = targetWidget();
|
QGraphicsWidget *w = targetWidget();
|
||||||
if (w && state() == QAbstractAnimation::Running) {
|
if (w && state() == QAbstractAnimation::Running) {
|
||||||
qreal delta = Animation::easingCurve().valueForProgress(
|
const qreal delta = currentTime / qreal(duration());
|
||||||
currentTime / qreal(duration()));
|
|
||||||
w->setPos(m_startPos * (1-delta) + (m_targetPos * delta));
|
w->setPos(m_startPos * (1-delta) + (m_targetPos * delta));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,8 +64,7 @@ void ZoomAnimation::updateEffectiveTime(int currentTime)
|
|||||||
{
|
{
|
||||||
QGraphicsWidget *w = targetWidget();
|
QGraphicsWidget *w = targetWidget();
|
||||||
if (w) {
|
if (w) {
|
||||||
qreal delta = Animation::easingCurve().valueForProgress(
|
qreal delta = currentTime / qreal(duration());
|
||||||
currentTime / qreal(duration()));
|
|
||||||
if (m_zoom != 1) {
|
if (m_zoom != 1) {
|
||||||
delta = (1 - m_zoom) * delta;
|
delta = (1 - m_zoom) * delta;
|
||||||
w->setScale(1 - delta);
|
w->setScale(1 - delta);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user