mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-24 13:08:44 +00:00
@@ -315,6 +315,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString*)description {
|
||||
NSMutableString *text = [[super description] mutableCopy];
|
||||
[text appendFormat:@" model: %@", _layerModel];
|
||||
return text;
|
||||
}
|
||||
|
||||
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
|
||||
|
||||
- (void)_setImageForAsset {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
if ([value isKindOfClass:[NSArray class]] &&
|
||||
[[(NSArray *)value firstObject] isKindOfClass:[NSDictionary class]] &&
|
||||
[(NSArray *)value firstObject][@"t"]) {
|
||||
//Keframes
|
||||
//Keyframes
|
||||
[self _buildAnimationForKeyframes:value];
|
||||
} else {
|
||||
//Single Value, no animation
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
}
|
||||
|
||||
[_assetGroup finalizeInitialization];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -30,7 +30,7 @@ typedef enum : NSInteger {
|
||||
LOTMatteTypeNone,
|
||||
LOTMatteTypeAdd,
|
||||
LOTMatteTypeInvert,
|
||||
LOTLayerTypeUknown
|
||||
LOTMatteTypeUnknown
|
||||
} LOTMatteType;
|
||||
|
||||
@interface LOTLayer : NSObject
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
_layerName = [jsonDictionary[@"nm"] copy];
|
||||
_layerID = [jsonDictionary[@"ind"] copy];
|
||||
|
||||
|
||||
NSNumber *layerType = jsonDictionary[@"ty"];
|
||||
_layerType = layerType.integerValue;
|
||||
|
||||
@@ -90,7 +89,7 @@
|
||||
|
||||
NSDictionary *position = ks[@"p"];
|
||||
if ([position[@"s"] boolValue]) {
|
||||
// Seperate dimensions
|
||||
// Separate dimensions
|
||||
_positionX = [[LOTAnimatableNumberValue alloc] initWithNumberValues:position[@"x"] frameRate:_framerate];
|
||||
_positionY = [[LOTAnimatableNumberValue alloc] initWithNumberValues:position[@"y"] frameRate:_framerate];
|
||||
} else {
|
||||
@@ -162,4 +161,11 @@
|
||||
[_anchor remapPointsFromBounds:_layerBounds toBounds:CGRectMake(0, 0, 1, 1)];
|
||||
}
|
||||
|
||||
- (NSString*)description {
|
||||
NSMutableString *text = [[super description] mutableCopy];
|
||||
[text appendFormat:@" %@ id: %d pid: %d frames: %d-%d", _layerName, (int)_layerID.integerValue, (int)_parentID.integerValue,
|
||||
(int)_inFrame.integerValue, (int)_outFrame.integerValue];
|
||||
return text;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -63,8 +63,21 @@
|
||||
} else if ([type isEqualToString:@"tm"]) {
|
||||
LOTShapeTrimPath *trim = [[LOTShapeTrimPath alloc] initWithJSON:itemJSON frameRate:frameRate];
|
||||
return trim;
|
||||
} else if ([type isEqualToString:@"gs"] || [type isEqualToString:@"gf"]) {
|
||||
// gs = gradient stroke
|
||||
// gf = gradient fill
|
||||
NSLog(@"%s: Warning: gradients are not supported", __PRETTY_FUNCTION__);
|
||||
} else if ([type isEqualToString:@"sr"]) {
|
||||
NSLog(@"%s: Warning: star is not supported. Convert to vector path?", __PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSString*)description {
|
||||
NSMutableString *text = [[super description] mutableCopy];
|
||||
[text appendFormat:@" items: %@", self.items];
|
||||
return text;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -66,6 +66,18 @@
|
||||
_opacity = [[LOTAnimatableNumberValue alloc] initWithNumberValues:opacity frameRate:frameRate];
|
||||
[_opacity remapValuesFromMin:@0 fromMax:@100 toMin:@0 toMax:@1];
|
||||
}
|
||||
|
||||
NSString *name = jsonDictionary[@"nm"];
|
||||
|
||||
NSDictionary *skew = jsonDictionary[@"sk"];
|
||||
BOOL hasSkew = (skew && [skew[@"k"] isEqual:@0] == NO);
|
||||
NSDictionary *skewAxis = jsonDictionary[@"sa"];
|
||||
BOOL hasSkewAxis = (skewAxis && [skewAxis[@"k"] isEqual:@0] == NO);
|
||||
|
||||
if (hasSkew || hasSkewAxis) {
|
||||
NSLog(@"%s: Warning: skew is not supported: %@", __PRETTY_FUNCTION__, name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
|
||||
Reference in New Issue
Block a user