lottie/vector: make dashoffset optional data in dash array. 30/194130/3
authorsubhransu mohanty <sub.mohanty@samsung.com>
Thu, 29 Nov 2018 08:04:01 +0000 (17:04 +0900)
committerHermet Park <chuneon.park@samsung.com>
Fri, 30 Nov 2018 04:11:06 +0000 (04:11 +0000)
Change-Id: Ieb3358a05f3d671f30d57147e2c4db0482ea1a54

src/vector/vdasher.cpp
src/vector/vdasher.h

index 987668e5e9b84c1c4f8afe9da3deedced5f66239..1e4ddd12ee6bd0f19f936a452233281148116b1d 100644 (file)
@@ -6,11 +6,10 @@ V_BEGIN_NAMESPACE
 
 VDasher::VDasher(const float *dashArray, int size)
 {
-    if (!(size % 2)) vCritical << "invalid dashArray format";
-
     mDashArray = reinterpret_cast<const VDasher::Dash *>(dashArray);
     mArraySize = size / 2;
-    mDashOffset = dashArray[size - 1];
+    if (size % 2)
+        mDashOffset = dashArray[size - 1];
     mIndex = 0;
     mCurrentLength = 0;
     mDiscard = false;
index 2e400603e4309de1287de2dc77a82512c0d528b3..5eeaad5e9cd655a2f1fb1369b480dc07cb6acf30 100644 (file)
@@ -24,12 +24,12 @@ private:
         float gap;
     };
     const VDasher::Dash *mDashArray;
-    int                  mArraySize;
+    int                  mArraySize{0};
     VPointF              mCurPt;
-    int                  mIndex; /* index to the dash Array */
+    int                  mIndex{0}; /* index to the dash Array */
     float                mCurrentLength;
     bool                 mDiscard;
-    float                mDashOffset;
+    float                mDashOffset{0};
     VPath                mResult;
     bool                 mStartNewSegment=true;
 };