* https://github.com/airbnb/lottie-web/blob/master/docs/json/shapes/rect.json */
| 1257 | * https://github.com/airbnb/lottie-web/blob/master/docs/json/shapes/rect.json |
| 1258 | */ |
| 1259 | model::Rect *LottieParserImpl::parseRectObject() |
| 1260 | { |
| 1261 | auto obj = allocator().make<model::Rect>(); |
| 1262 | |
| 1263 | while (const char *key = NextObjectKey()) { |
| 1264 | if (0 == strcmp(key, "nm")) { |
| 1265 | obj->setName(GetString()); |
| 1266 | } else if (0 == strcmp(key, "p")) { |
| 1267 | parseProperty(obj->mPos); |
| 1268 | } else if (0 == strcmp(key, "s")) { |
| 1269 | parseProperty(obj->mSize); |
| 1270 | } else if (0 == strcmp(key, "r")) { |
| 1271 | parseProperty(obj->mRound); |
| 1272 | } else if (0 == strcmp(key, "d")) { |
| 1273 | obj->mDirection = GetInt(); |
| 1274 | } else if (0 == strcmp(key, "hd")) { |
| 1275 | obj->setHidden(GetBool()); |
| 1276 | } else { |
| 1277 | Skip(key); |
| 1278 | } |
| 1279 | } |
| 1280 | obj->setStatic(obj->mPos.isStatic() && obj->mSize.isStatic() && |
| 1281 | obj->mRound.isStatic()); |
| 1282 | return obj; |
| 1283 | } |
| 1284 | |
| 1285 | /* |
| 1286 | * https://github.com/airbnb/lottie-web/blob/master/docs/json/shapes/ellipse.json |