mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
lottie: ++stability
ensure that the loading has been completed before overriding.
This commit is contained in:
parent
3de7580d96
commit
0268e9e3d1
1 changed files with 4 additions and 1 deletions
|
@ -262,7 +262,8 @@ bool LottieLoader::read()
|
||||||
|
|
||||||
Paint* LottieLoader::paint()
|
Paint* LottieLoader::paint()
|
||||||
{
|
{
|
||||||
this->done();
|
done();
|
||||||
|
|
||||||
if (!comp) return nullptr;
|
if (!comp) return nullptr;
|
||||||
comp->initiated = true;
|
comp->initiated = true;
|
||||||
return comp->root->scene;
|
return comp->root->scene;
|
||||||
|
@ -271,6 +272,8 @@ Paint* LottieLoader::paint()
|
||||||
|
|
||||||
bool LottieLoader::override(const char* slot)
|
bool LottieLoader::override(const char* slot)
|
||||||
{
|
{
|
||||||
|
if (!comp) done();
|
||||||
|
|
||||||
if (!comp || comp->slots.count == 0) return false;
|
if (!comp || comp->slots.count == 0) return false;
|
||||||
|
|
||||||
auto success = true;
|
auto success = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue