Swiftgram/src/vector/vpathmesure.cpp
sub.mohanty@samsung.com e6bce26b6e lottie: fix some more warning.
Change-Id: I0b1fe8773ec1f795e7df603a35a02687697f3e00
2018-07-28 17:08:32 +09:00

29 lines
564 B
C++

#include"vpathmesure.h"
#include"vbezier.h"
#include"vdasher.h"
V_BEGIN_NAMESPACE
void VPathMesure::setOffset(float sp, float ep)
{
startOffset = sp;
endOffset = ep;
}
VPath VPathMesure::trim(const VPath &path)
{
if (vCompare(startOffset, 0.0f) && (vCompare(endOffset, 1.0f))) return path;
float len = path.length();
float sg = len * startOffset;
float eg = len * (1.0f - endOffset);
len = len - (sg + eg);
float array[5] = { 0.0f, sg, len, 1000, 0.0f };
VDasher dasher(array, 5);
return dasher.dashed(path);
}
V_END_NAMESPACE