mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +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) return 0.0f;
|
||||
|
||||
auto frameNo = frameCnt * (segmentEnd - segmentBegin);
|
||||
return frameNo / comp->frameRate;
|
||||
return frameCnt * (segmentEnd - segmentBegin) / comp->frameRate;
|
||||
}
|
||||
|
||||
|
||||
|
@ -378,7 +377,7 @@ uint32_t LottieLoader::markersCnt()
|
|||
const char* LottieLoader::markers(uint32_t index)
|
||||
{
|
||||
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;
|
||||
return (*marker)->name;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue