lottie: Process Dash info inside lottie library. 94/194994/2
authorsubhransu mohanty <sub.mohanty@samsung.com>
Mon, 10 Dec 2018 05:58:19 +0000 (14:58 +0900)
committerHermet Park <chuneon.park@samsung.com>
Mon, 10 Dec 2018 08:05:09 +0000 (08:05 +0000)
Change-Id: I7ecec5a94db20b81d0fbb9f620f3eef845b1aaa0

src/lottie/lottieitem.cpp

index 8170c1654c7c3440f2cec89bd7555cbc6b3fc015..31ddb302ebe1667880a24200a683ba01c9d5269b 100644 (file)
@@ -1211,6 +1211,10 @@ void LOTDrawable::sync()
     if (mFlag & DirtyState::None) return;
 
     if (mFlag & DirtyState::Path) {
+        if (mStroke.mDash.size()) {
+            VDasher dasher(mStroke.mDash.data(), mStroke.mDash.size());
+            mPath = dasher.dashed(mPath);
+        }
         const std::vector<VPath::Element> &elm = mPath.elements();
         const std::vector<VPointF> &       pts = mPath.points();
         const float *ptPtr = reinterpret_cast<const float *>(pts.data());
@@ -1256,10 +1260,6 @@ void LOTDrawable::sync()
             mCNode->mStroke.join = LOTJoinStyle::JoinMiter;
             break;
         }
-
-        mCNode->mStroke.dashArray = mStroke.mDash.data();
-        mCNode->mStroke.dashArraySize = mStroke.mDash.size();
-
     } else {
         mCNode->mStroke.enable = 0;
     }