From 547434e2a6d5e0ce3fc2041518bf86d0c233d112 Mon Sep 17 00:00:00 2001 From: Jaeun Choi Date: Fri, 20 Jul 2018 17:59:34 +0900 Subject: [PATCH] lottie: fixed miscellaneous things regarding trim operation - check if path operator is there before applying it - fixed comment - fixed indentation Change-Id: I2b491423cea3a40e5c28436686b24f92d1e6bcfd --- src/lottie/lottieitem.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lottie/lottieitem.cpp b/src/lottie/lottieitem.cpp index 06797d1..d928b74 100644 --- a/src/lottie/lottieitem.cpp +++ b/src/lottie/lottieitem.cpp @@ -607,7 +607,8 @@ LOTShapeLayerItem::LOTShapeLayerItem(LOTLayerData *layerData):LOTLayerItem(layer mRoot = new LOTContentGroupItem(nullptr); mRoot->addChildren(layerData); mRoot->processPaintOperation(); - mRoot->processTrimOperation(); + if (layerData->hasPathOperator()) + mRoot->processTrimOperation(); } LOTShapeLayerItem::~LOTShapeLayerItem() @@ -781,7 +782,7 @@ void LOTContentGroupItem::trimOperationHelper(std::vector &list) for (auto i = mContents.rbegin(); i != mContents.rend(); ++i) { auto child = *i; if (auto pathNode = dynamic_cast(child)) { - // the node is a path data node add the paint operation list to it. + // the node is a path data node add the trim operation list to it. pathNode->addTrimOperation(list); } else if (auto trimNode = dynamic_cast(child)) { // add it to the trim operation list @@ -797,7 +798,7 @@ void LOTContentGroupItem::trimOperationHelper(std::vector &list) void LOTPathDataItem::addTrimOperation(std::vector &list) { for(auto trimItem : list) { - mTrimNodeRefs.push_back(trimItem); + mTrimNodeRefs.push_back(trimItem); } } -- 2.7.4