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

Method parseShapeObject

src/lottie/lottieparser.cpp:1314–1337  ·  view source on GitHub ↗

* https://github.com/airbnb/lottie-web/blob/master/docs/json/shapes/shape.json */

Source from the content-addressed store, hash-verified

1312 * https://github.com/airbnb/lottie-web/blob/master/docs/json/shapes/shape.json
1313 */
1314model::Path *LottieParserImpl::parseShapeObject()
1315{
1316 auto obj = allocator().make<model::Path>();
1317
1318 while (const char *key = NextObjectKey()) {
1319 if (0 == strcmp(key, "nm")) {
1320 obj->setName(GetString());
1321 } else if (0 == strcmp(key, "ks")) {
1322 parseShapeProperty(obj->mShape);
1323 } else if (0 == strcmp(key, "d")) {
1324 obj->mDirection = GetInt();
1325 } else if (0 == strcmp(key, "hd")) {
1326 obj->setHidden(GetBool());
1327 } else {
1328#ifdef DEBUG_PARSER
1329 vDebug << "Shape property ignored :" << key;
1330#endif
1331 Skip(key);
1332 }
1333 }
1334 obj->setStatic(obj->mShape.isStatic());
1335
1336 return obj;
1337}
1338
1339/*
1340 * https://github.com/airbnb/lottie-web/blob/master/docs/json/shapes/star.json

Callers

nothing calls this directly

Calls 7

GetIntFunction · 0.85
GetBoolFunction · 0.85
setHiddenMethod · 0.80
GetStringFunction · 0.50
setNameMethod · 0.45
setStaticMethod · 0.45
isStaticMethod · 0.45

Tested by

no test coverage detected