summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2019-04-08 18:41:01 +0300
committerKonstantin Ritt <ritt.ks@gmail.com>2019-04-09 04:28:45 +0000
commitba71d45911fab14763cad4c9aca4798f17a4fbff (patch)
tree0797ad1d452b2c93e19c226be2f97eee95baa854
parent64d852f29fc3e98659b242b7a049ec27fc7a80d3 (diff)
LottieAnimation: get rid of redundant calls
+ move code around Change-Id: Ic2141edda37af519f39650d17e98a51d3b348b00 Reviewed-by: Rebecca Worledge <rebecca.worledge@theqtcompany.com>
-rw-r--r--src/imports/lottieanimation.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/imports/lottieanimation.cpp b/src/imports/lottieanimation.cpp
index c21d833..58eb500 100644
--- a/src/imports/lottieanimation.cpp
+++ b/src/imports/lottieanimation.cpp
@@ -605,11 +605,6 @@ bool LottieAnimation::loadSource(QString filename)
return false;
}
- setWidth(m_animWidth);
- emit widthChanged();
- setHeight(m_animHeight);
- emit heightChanged();
-
sourceFile.close();
QMetaObject::invokeMethod(m_frameRenderThread, "registerAnimator", Q_ARG(LottieAnimation*, this));
@@ -676,9 +671,6 @@ int LottieAnimation::parse(QByteArray jsonSource)
m_animWidth = rootObj.value(QLatin1String("w")).toVariant().toReal();
m_animHeight = rootObj.value(QLatin1String("h")).toVariant().toReal();
- setWidth(m_animWidth);
- setHeight(m_animHeight);
-
QJsonArray markerArr = rootObj.value(QLatin1String("markers")).toArray();
QJsonArray::const_iterator markerIt = markerArr.constBegin();
while (markerIt != markerArr.constEnd()) {
@@ -698,6 +690,8 @@ int LottieAnimation::parse(QByteArray jsonSource)
if (rootObj.value(QLatin1String("chars")).toArray().count())
qCWarning(lcLottieQtBodymovinParser) << "chars not supported";
+ setWidth(m_animWidth);
+ setHeight(m_animHeight);
setStartFrame(startFrame);
setEndFrame(endFrame);
setFrameRate(m_animFrameRate);