mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
lottie/builder: Fix a broken animation
The animation couldn't be triggered on a single thread.
Regression bug introduced by 29b5bc372d
This commit is contained in:
parent
29b5bc372d
commit
b133b2a8ae
1 changed files with 4 additions and 8 deletions
|
@ -75,6 +75,7 @@ void LottieLoader::run(unsigned tid)
|
|||
w = static_cast<float>(comp->w);
|
||||
h = static_cast<float>(comp->h);
|
||||
frameDuration = comp->duration();
|
||||
frameCnt = comp->frameCnt();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,10 +107,9 @@ bool LottieLoader::header()
|
|||
{
|
||||
//A single thread doesn't need to perform intensive tasks.
|
||||
if (TaskScheduler::threads() == 0) {
|
||||
LottieParser parser(content, dirName);
|
||||
if (!parser.parse()) return false;
|
||||
comp = parser.comp;
|
||||
return true;
|
||||
run(0);
|
||||
if (comp) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
//Quickly validate the given Lottie file without parsing in order to get the animation info.
|
||||
|
@ -298,10 +298,6 @@ bool LottieLoader::read()
|
|||
|
||||
TaskScheduler::request(this);
|
||||
|
||||
if (comp && TaskScheduler::threads() == 0) {
|
||||
frameCnt = comp->frameCnt();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue