lottie/parser: parse precomp layer's with and height attribute. 36/196636/1 accepted/tizen/unified/20190111.055111 submit/tizen/20190109.051753
authorsubhransu mohanty <sub.mohanty@samsung.com>
Thu, 3 Jan 2019 06:17:55 +0000 (15:17 +0900)
committersubhransu mohanty <sub.mohanty@samsung.com>
Thu, 3 Jan 2019 06:17:55 +0000 (15:17 +0900)
Change-Id: Ib975f753424acae422889b2ade611d664fe07392

src/lottie/lottiemodel.h
src/lottie/lottieparser.cpp

index 23e6171..47faccf 100644 (file)
@@ -363,6 +363,7 @@ public:
     LottieColor solidColor() const noexcept{return mSolidLayer.mColor;}
     bool autoOrient() const noexcept{return mAutoOrient;}
     int timeRemap(int frameNo) const;
+    VSize layerSize() const {return mLayerSize;}
 public:
     struct SolidLayer {
         int            mWidth{0};
@@ -378,6 +379,7 @@ public:
     long                 mInFrame{0};
     long                 mOutFrame{0};
     long                 mStartFrame{0};
+    VSize                mLayerSize;
     LottieBlendMode      mBlendMode{LottieBlendMode::Normal};
     float                mTimeStreatch{1.0f};
     std::string          mPreCompRefId;
index 5732453..06d76d1 100644 (file)
@@ -804,6 +804,10 @@ std::shared_ptr<LOTData> LottieParserImpl::parseLayer()
             layer->mTransform = parseTransformObject(ddd);
         } else if (0 == strcmp(key, "shapes")) {
             parseShapesAttr(layer);
+        } else if (0 == strcmp(key, "w")) {
+            layer->mLayerSize.setWidth(GetInt());
+        } else if (0 == strcmp(key, "h")) {
+            layer->mLayerSize.setHeight(GetInt());
         } else if (0 == strcmp(key, "sw")) {
             layer->mSolidLayer.mWidth = GetInt();
         } else if (0 == strcmp(key, "sh")) {
@@ -1944,7 +1948,10 @@ public:
                << "Composition:: a: " << !obj->isStatic()
                << ", v: " << obj->mVersion
                << ", stFm: " << obj->startFrame()
-               << ", endFm: " << obj->endFrame()<< "\n";
+               << ", endFm: " << obj->endFrame()
+               << ", W: " << obj->size().width()
+               << ", H: " << obj->size().height()
+               << "\n";
         level.append("\t");
         visit(obj->mRootLayer.get(), level);
         level.erase(level.end() - 1, level.end());
@@ -1965,6 +1972,8 @@ public:
                << ", ts:" << obj->mTimeStreatch
                << ", ao:" << obj->autoOrient()
                << ", ddd:" << obj->mTransform->ddd()
+               << ", W:" << obj->layerSize().width()
+               << ", H:" << obj->layerSize().height()
                << "\n";
         visitChildren(static_cast<LOTGroupData *>(obj), level);
         vDebug << level