mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
parent
db800c8d45
commit
931d0748bb
2 changed files with 7 additions and 3 deletions
|
@ -162,7 +162,7 @@ struct UserExample : tvgexam::Example
|
|||
auto picture = slot3->picture();
|
||||
if (!tvgexam::verify(picture->load(EXAMPLE_DIR"/lottie/extensions/slotsample3.json"))) return false;
|
||||
|
||||
const char* slotJson = R"({"path_img":{"id":"image_0","w":200,"h":300,"u":"images/","p":"logo.png","e":0}})";
|
||||
const char* slotJson = R"({"path_img":{"p":{"id":"image_0","w":200,"h":300,"u":"images/","p":"logo.png","e":0}}})";
|
||||
if (!tvgexam::verify(slot3->override(slotJson))) return false;
|
||||
|
||||
sizing(picture, 3);
|
||||
|
|
|
@ -958,6 +958,8 @@ void LottieParser::parseImage(LottieImage* image, const char* data, const char*
|
|||
|
||||
LottieObject* LottieParser::parseAsset()
|
||||
{
|
||||
enterObject();
|
||||
|
||||
LottieObject* obj = nullptr;
|
||||
unsigned long id = 0;
|
||||
|
||||
|
@ -1019,7 +1021,6 @@ void LottieParser::parseAssets()
|
|||
{
|
||||
enterArray();
|
||||
while (nextArrayValue()) {
|
||||
enterObject();
|
||||
auto asset = parseAsset();
|
||||
if (asset) comp->assets.push(asset);
|
||||
else TVGERR("LOTTIE", "Invalid Asset!");
|
||||
|
@ -1508,7 +1509,10 @@ bool LottieParser::apply(LottieSlot* slot, bool byDefault)
|
|||
break;
|
||||
}
|
||||
case LottieProperty::Type::Image: {
|
||||
obj = parseAsset();
|
||||
while (auto key = nextObjectKey()) {
|
||||
if (KEY_AS("p")) obj = parseAsset();
|
||||
else skip(key);
|
||||
}
|
||||
context.parent = obj;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue