Respect hidden property on strokes

This commit is contained in:
Ilya Laktyushin
2019-06-11 19:10:23 +02:00
parent ff36611457
commit d40e390fbe
3 changed files with 12 additions and 3 deletions

View File

@@ -27,6 +27,7 @@ typedef enum : NSUInteger {
@property (nonatomic, readonly) NSString *keyname;
@property (nonatomic, readonly) BOOL fillEnabled;
@property (nonatomic, readonly) BOOL hidden;
@property (nonatomic, readonly) LOTKeyframeGroup *color;
@property (nonatomic, readonly) LOTKeyframeGroup *opacity;
@property (nonatomic, readonly) LOTKeyframeGroup *width;

View File

@@ -42,6 +42,11 @@
return LOT_RemapValue(inValue, 0, 100, 0, 1);
}];
}
NSNumber *hidden = jsonDictionary[@"hd"];
if (hidden.boolValue) {
_hidden = true;
}
_capType = [jsonDictionary[@"lc"] integerValue] - 1;
_joinType = [jsonDictionary[@"lj"] integerValue] - 1;

View File

@@ -74,10 +74,13 @@
[self.containerLayer insertSublayer:fillRenderer.outputLayer atIndex:0];
previousNode = fillRenderer;
} else if ([item isKindOfClass:[LOTShapeStroke class]]) {
LOTStrokeRenderer *strokRenderer = [[LOTStrokeRenderer alloc] initWithInputNode:previousNode
if (((LOTShapeStroke *)item).hidden) {
continue;
}
LOTStrokeRenderer *strokeRenderer = [[LOTStrokeRenderer alloc] initWithInputNode:previousNode
shapeStroke:(LOTShapeStroke *)item];
[self.containerLayer insertSublayer:strokRenderer.outputLayer atIndex:0];
previousNode = strokRenderer;
[self.containerLayer insertSublayer:strokeRenderer.outputLayer atIndex:0];
previousNode = strokeRenderer;
} else if ([item isKindOfClass:[LOTShapePath class]]) {
LOTPathAnimator *pathAnimator = [[LOTPathAnimator alloc] initWithInputNode:previousNode
shapePath:(LOTShapePath *)item];