From eea5add913e0b9fd0c2d236541ec5d5f1975a5a5 Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Thu, 23 Aug 2018 17:07:48 +0900 Subject: [PATCH] lottie: fixed regression caused by last commit There was issue caused by item inside of groups. Change-Id: If9057db4f183fc2956d3bd43dca92fc5bb628202 --- src/lottie/lottieitem.cpp | 7 +++---- src/lottie/lottieitem.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lottie/lottieitem.cpp b/src/lottie/lottieitem.cpp index 23810d9..84945b6 100644 --- a/src/lottie/lottieitem.cpp +++ b/src/lottie/lottieitem.cpp @@ -589,14 +589,13 @@ void LOTContentGroupItem::processPathItems( list.push_back(pathNode); } else if (auto paintNode = dynamic_cast(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(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 &list) } -void LOTPaintDataItem::addPathItems(std::vector &list) +void LOTPaintDataItem::addPathItems(std::vector &list, int startOffset) { - mPathItems = list; + std::copy(list.begin() + startOffset, list.end(), back_inserter(mPathItems)); } diff --git a/src/lottie/lottieitem.h b/src/lottie/lottieitem.h index 0af1183..e260d2d 100644 --- a/src/lottie/lottieitem.h +++ b/src/lottie/lottieitem.h @@ -362,7 +362,7 @@ class LOTPaintDataItem : public LOTContentItem { public: LOTPaintDataItem(bool staticContent); - void addPathItems(std::vector &list); + void addPathItems(std::vector &list, int startOffset); virtual void update(int frameNo, const VMatrix &parentMatrix, float parentAlpha, const DirtyFlag &flag); void renderList(std::vector &list) final; protected: -- 2.7.4