* https://github.com/airbnb/lottie-web/blob/master/docs/json/shapes/shape.json */
| 1312 | * https://github.com/airbnb/lottie-web/blob/master/docs/json/shapes/shape.json |
| 1313 | */ |
| 1314 | model::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 |