mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-15 12:34:30 +00:00
lottie: code clean up
This commit is contained in:
parent
51eec98aae
commit
ab4cf28888
1 changed files with 2 additions and 3 deletions
|
@ -356,8 +356,7 @@ float LottieLoader::duration()
|
||||||
if (!comp) done();
|
if (!comp) done();
|
||||||
if (!comp) return 0.0f;
|
if (!comp) return 0.0f;
|
||||||
|
|
||||||
auto frameNo = frameCnt * (segmentEnd - segmentBegin);
|
return frameCnt * (segmentEnd - segmentBegin) / comp->frameRate;
|
||||||
return frameNo / comp->frameRate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -378,7 +377,7 @@ uint32_t LottieLoader::markersCnt()
|
||||||
const char* LottieLoader::markers(uint32_t index)
|
const char* LottieLoader::markers(uint32_t index)
|
||||||
{
|
{
|
||||||
if (!comp) done();
|
if (!comp) done();
|
||||||
if (!comp || index < 0 || index >= markersCnt()) return nullptr;
|
if (!comp || index >= comp->markers.count) return nullptr;
|
||||||
auto marker = comp->markers.begin() + index;
|
auto marker = comp->markers.begin() + index;
|
||||||
return (*marker)->name;
|
return (*marker)->name;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue