mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-11 17:00:02 +00:00
lottie/vdasher: remove connected dash lines between pathes
Since managing multiple pathes by a painter or a stroke, multiple pathes will be drawn in one "dashed" function call. And its vdasher's moveTo() function only do the job properly when there is only one moveTo call. Now, the moveTo() function initialize internal properties properly. Change-Id: I4dd45d480f27dce734ce2ef8d1ff38774c589e64
This commit is contained in:
parent
d2fc8fc576
commit
f86f1bedd7
@ -70,6 +70,7 @@ VDasher::VDasher(const float *dashArray, int size)
|
||||
void VDasher::moveTo(const VPointF &p)
|
||||
{
|
||||
mIsCurrentOperationGap = false;
|
||||
mNewSegment = false;
|
||||
mStartPt = p;
|
||||
mCurPt = p;
|
||||
|
||||
@ -101,8 +102,7 @@ void VDasher::moveTo(const VPointF &p)
|
||||
normalizeLen -= mDashArray[i].gap;
|
||||
}
|
||||
} else {
|
||||
mCurrentDashIndex = 0;
|
||||
mCurrentDashLength = mDashArray[0].length;
|
||||
mCurrentDashLength = mDashArray[mCurrentDashIndex].length;
|
||||
}
|
||||
}
|
||||
|
||||
@ -229,6 +229,7 @@ VPath VDasher::dashed(const VPath &path)
|
||||
if (path.isEmpty()) return VPath();
|
||||
|
||||
mDashedPath = VPath();
|
||||
mCurrentDashIndex = 0;
|
||||
const std::vector<VPath::Element> &elms = path.elements();
|
||||
const std::vector<VPointF> & pts = path.points();
|
||||
const VPointF * ptPtr = pts.data();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user