From 54e5e4cd44702b56f1e1cddbe049ee02a87add36 Mon Sep 17 00:00:00 2001 From: subhransu mohanty Date: Thu, 29 Nov 2018 17:04:01 +0900 Subject: [PATCH] lottie/vector: make dashoffset optional data in dash array. Change-Id: Ieb3358a05f3d671f30d57147e2c4db0482ea1a54 --- src/vector/vdasher.cpp | 5 ++--- src/vector/vdasher.h | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/vector/vdasher.cpp b/src/vector/vdasher.cpp index 987668e..1e4ddd1 100644 --- a/src/vector/vdasher.cpp +++ b/src/vector/vdasher.cpp @@ -6,11 +6,10 @@ V_BEGIN_NAMESPACE VDasher::VDasher(const float *dashArray, int size) { - if (!(size % 2)) vCritical << "invalid dashArray format"; - mDashArray = reinterpret_cast(dashArray); mArraySize = size / 2; - mDashOffset = dashArray[size - 1]; + if (size % 2) + mDashOffset = dashArray[size - 1]; mIndex = 0; mCurrentLength = 0; mDiscard = false; diff --git a/src/vector/vdasher.h b/src/vector/vdasher.h index 2e40060..5eeaad5 100644 --- a/src/vector/vdasher.h +++ b/src/vector/vdasher.h @@ -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; }; -- 2.34.1