rlottie: Get size data from the model
authorsub.mohanty@samsung.com <smohantty@gmail.com>
Thu, 27 Jun 2019 12:47:45 +0000 (21:47 +0900)
committerHermet Park <hermetpark@gmail.com>
Wed, 10 Jul 2019 01:55:52 +0000 (10:55 +0900)
src/lottie/lottieanimation.cpp
src/lottie/lottieitem.cpp
src/lottie/lottieitem.h
src/lottie/lottiemodel.h

index 7b11f4f..2ff5dc4 100644 (file)
@@ -39,7 +39,7 @@ class AnimationImpl {
 public:
     void    init(const std::shared_ptr<LOTModel> &model);
     bool    update(size_t frameNo, const VSize &size);
-    VSize   size() const { return mCompItem->size(); }
+    VSize   size() const { return mModel->size(); }
     double  duration() const { return mModel->duration(); }
     double  frameRate() const { return mModel->frameRate(); }
     size_t  totalFrame() const { return mModel->totalFrame(); }
index 14ff732..f074184 100644 (file)
@@ -116,11 +116,6 @@ void LOTCompItem::resize(const VSize &size)
     mUpdateViewBox = true;
 }
 
-VSize LOTCompItem::size() const
-{
-    return mViewSize;
-}
-
 bool LOTCompItem::update(int frameNo)
 {
     // check if cached frame is same as requested frame.
index 407994d..a363f47 100644 (file)
@@ -67,7 +67,7 @@ public:
    static std::unique_ptr<LOTLayerItem> createLayerItem(LOTLayerData *layerData);
    bool update(int frameNo);
    void resize(const VSize &size);
-   VSize size() const;
+   VSize size() const { return mViewSize;}
    void buildRenderTree();
    const LOTLayerNode * renderTree()const;
    bool render(const rlottie::Surface &surface);
index 2284d25..0251174 100644 (file)
@@ -955,6 +955,7 @@ class LOTModel
 {
 public:
    bool  isStatic() const {return mRoot->isStatic();}
+   VSize size() const {return mRoot->size();}
    double duration() const {return mRoot->duration();}
    size_t totalFrame() const {return mRoot->totalFrame();}
    size_t frameDuration() const {return mRoot->frameDuration();}