move traverseSubviews method to SVGNode

This commit is contained in:
Horcrux
2016-12-02 15:17:55 +08:00
parent 179560a1f5
commit 5bb8c3d48f
4 changed files with 17 additions and 16 deletions
+4 -5
View File
@@ -13,11 +13,10 @@
- (void)renderTo:(CGContextRef)context - (void)renderTo:(CGContextRef)context
{ {
for (RNSVGNode *node in self.subviews) { [self traverseSubviews:^(RNSVGNode *node) {
if ([node isKindOfClass:[RNSVGNode class]]) { [node saveDefinition];
[node saveDefinition]; return YES;
} }];
}
} }
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
-11
View File
@@ -99,16 +99,5 @@
}]; }];
} }
- (void)traverseSubviews:(BOOL (^)(RNSVGNode *node))block
{
for (RNSVGNode *node in self.subviews) {
if ([node isKindOfClass:[RNSVGNode class]]) {
if (!block(node)) {
break;
}
}
}
}
@end @end
+2
View File
@@ -78,4 +78,6 @@
- (void)endTransparencyLayer:(CGContextRef)context; - (void)endTransparencyLayer:(CGContextRef)context;
- (void)traverseSubviews:(BOOL (^)(RNSVGNode *node))block;
@end @end
+11
View File
@@ -191,6 +191,17 @@
// abstract // abstract
} }
- (void)traverseSubviews:(BOOL (^)(RNSVGNode *node))block
{
for (RNSVGNode *node in self.subviews) {
if ([node isKindOfClass:[RNSVGNode class]]) {
if (!block(node)) {
break;
}
}
}
}
- (void)resetProperties - (void)resetProperties
{ {
// abstract // abstract