From 2cefb096768b1d8d30b4d0705a622f1c7d041344 Mon Sep 17 00:00:00 2001 From: Wang Chuan Date: Thu, 2 Apr 2020 22:24:22 +0800 Subject: OpacityAnimator: apply opacity animation to the first frame in SG When using OpacityAnimator, an opacity node will be created and inserted into nodes tree to perform opacity animation. However, since the default value of opacity node is 1, the opacity animation will start from 1 even if we set it from 0 to 1. Fixes this issue by updating the value of opacity just after creating a new opacity node. Fixes: QTBUG-79199 Change-Id: I2e462f0c56892fda040836ffde6685145769e60c Reviewed-by: Shawn Rutledge --- src/quick/util/qquickanimatorjob.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/quick/util') diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp index a9caedec4f..84480ddd18 100644 --- a/src/quick/util/qquickanimatorjob.cpp +++ b/src/quick/util/qquickanimatorjob.cpp @@ -582,6 +582,7 @@ void QQuickOpacityAnimatorJob::postSync() } d->extra.value().opacityNode = m_opacityNode; + updateCurrentTime(0); } Q_ASSERT(m_opacityNode); } -- cgit v1.2.3