lottie: fixed regression caused by last commit 45/187445/1
authorYoungbok Shin <youngb.shin@samsung.com>
Thu, 23 Aug 2018 08:07:48 +0000 (17:07 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Thu, 23 Aug 2018 08:07:48 +0000 (17:07 +0900)
There was issue caused by item inside of groups.

Change-Id: If9057db4f183fc2956d3bd43dca92fc5bb628202

src/lottie/lottieitem.cpp
src/lottie/lottieitem.h

index 23810d9..84945b6 100644 (file)
@@ -589,14 +589,13 @@ void LOTContentGroupItem::processPathItems(
             list.push_back(pathNode);
         } else if (auto paintNode = dynamic_cast<LOTPaintDataItem *>(i.get())) {
             // the node is a paint data node update the path list of the paint item.
-            paintNode->addPathItems(list);
+            paintNode->addPathItems(list, curOpCount);
         } else if (auto groupNode =
                        dynamic_cast<LOTContentGroupItem *>(i.get())) {
             // update the groups node with current list
             groupNode->processPathItems(list);
         }
     }
-    list.erase(list.begin() + curOpCount, list.end());
 }
 
 void LOTContentGroupItem::processTrimOperation()
@@ -800,9 +799,9 @@ void LOTPaintDataItem::renderList(std::vector<VDrawable *> &list)
 }
 
 
-void LOTPaintDataItem::addPathItems(std::vector<LOTPathDataItem *> &list)
+void LOTPaintDataItem::addPathItems(std::vector<LOTPathDataItem *> &list, int startOffset)
 {
-    mPathItems = list;
+    std::copy(list.begin() + startOffset, list.end(), back_inserter(mPathItems));
 }
 
 
index 0af1183..e260d2d 100644 (file)
@@ -362,7 +362,7 @@ class LOTPaintDataItem : public LOTContentItem
 {
 public:
    LOTPaintDataItem(bool staticContent);
-   void addPathItems(std::vector<LOTPathDataItem *> &list);
+   void addPathItems(std::vector<LOTPathDataItem *> &list, int startOffset);
    virtual void update(int frameNo, const VMatrix &parentMatrix, float parentAlpha, const DirtyFlag &flag);
    void renderList(std::vector<VDrawable *> &list) final;
 protected: