MCPcopy Create free account
hub / github.com/Samsung/rlottie / parseGroupObject

Method parseGroupObject

src/lottie/lottieparser.cpp:1220–1254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1218}
1219
1220model::Object *LottieParserImpl::parseGroupObject()
1221{
1222 auto group = allocator().make<model::Group>();
1223
1224 while (const char *key = NextObjectKey()) {
1225 if (0 == strcmp(key, "nm")) {
1226 group->setName(GetString());
1227 } else if (0 == strcmp(key, "it")) {
1228 RAPIDJSON_ASSERT(PeekType() == kArrayType);
1229 EnterArray();
1230 while (NextArrayValue()) {
1231 RAPIDJSON_ASSERT(PeekType() == kObjectType);
1232 parseObject(group);
1233 }
1234 if (group->mChildren.back()->type() ==
1235 model::Object::Type::Transform) {
1236 group->mTransform =
1237 static_cast<model::Transform *>(group->mChildren.back());
1238 group->mChildren.pop_back();
1239 }
1240 } else {
1241 Skip(key);
1242 }
1243 }
1244 bool staticFlag = true;
1245 for (const auto &child : group->mChildren) {
1246 staticFlag &= child->isStatic();
1247 }
1248
1249 if (group->mTransform) {
1250 group->setStatic(staticFlag && group->mTransform->isStatic());
1251 }
1252
1253 return group;
1254}
1255
1256/*
1257 * https://github.com/airbnb/lottie-web/blob/master/docs/json/shapes/rect.json

Callers

nothing calls this directly

Calls 5

GetStringFunction · 0.50
setNameMethod · 0.45
typeMethod · 0.45
isStaticMethod · 0.45
setStaticMethod · 0.45

Tested by

no test coverage detected