mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-05 07:59:28 +00:00
finish gradients refactor
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
{
|
||||
NSMutableDictionary<NSString *, RNSVGNode *> *clipPaths;
|
||||
NSMutableDictionary<NSString *, RNSVGNode *> *templates;
|
||||
NSMutableDictionary<NSString *, RNSVGBrushConverter *> *brushConverters;
|
||||
}
|
||||
|
||||
- (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex
|
||||
@@ -104,4 +105,25 @@
|
||||
return templates ? [templates objectForKey:tempalteRef] : nil;
|
||||
}
|
||||
|
||||
|
||||
- (void)defineBrushConverter:(RNSVGBrushConverter *)brushConverter brushConverterRef:(NSString *)brushConverterRef
|
||||
{
|
||||
if (!brushConverters) {
|
||||
brushConverters = [[NSMutableDictionary alloc] init];
|
||||
}
|
||||
[brushConverters setObject:brushConverter forKey:brushConverterRef];
|
||||
}
|
||||
|
||||
- (void)removeBrushConverter:(NSString *)brushConverterRef
|
||||
{
|
||||
if (brushConverters) {
|
||||
[brushConverters removeObjectForKey:brushConverterRef];
|
||||
}
|
||||
}
|
||||
|
||||
- (RNSVGBrushConverter *)getDefinedBrushConverter:(NSString *)brushConverterRef
|
||||
{
|
||||
return brushConverters ? [brushConverters objectForKey:brushConverterRef] : nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user