mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-17 02:49:57 +00:00
46 lines
1.0 KiB
Objective-C
46 lines
1.0 KiB
Objective-C
//
|
|
// LOTShapeRectangle.m
|
|
// LottieAnimator
|
|
//
|
|
// Created by Brandon Withrow on 12/15/15.
|
|
// Copyright © 2015 Brandon Withrow. All rights reserved.
|
|
//
|
|
|
|
#import "LOTShapeRectangle.h"
|
|
|
|
@implementation LOTShapeRectangle
|
|
|
|
- (instancetype)initWithJSON:(NSDictionary *)jsonDictionary {
|
|
self = [super init];
|
|
if (self) {
|
|
[self _mapFromJSON:jsonDictionary];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)_mapFromJSON:(NSDictionary *)jsonDictionary {
|
|
|
|
if (jsonDictionary[@"nm"] ) {
|
|
_keyname = [jsonDictionary[@"nm"] copy];
|
|
}
|
|
|
|
NSDictionary *position = jsonDictionary[@"p"];
|
|
if (position) {
|
|
_position = [[LOTKeyframeGroup alloc] initWithData:position];
|
|
}
|
|
|
|
NSDictionary *cornerRadius = jsonDictionary[@"r"];
|
|
if (cornerRadius) {
|
|
_cornerRadius = [[LOTKeyframeGroup alloc] initWithData:cornerRadius];
|
|
}
|
|
|
|
NSDictionary *size = jsonDictionary[@"s"];
|
|
if (size) {
|
|
_size = [[LOTKeyframeGroup alloc] initWithData:size];
|
|
}
|
|
NSNumber *reversed = jsonDictionary[@"d"];
|
|
_reversed = (reversed.integerValue == 3);
|
|
}
|
|
|
|
@end
|