mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-05 22:56:11 +00:00
Added CI workflow and local pre-commit hook for formatting and linting the newly added JS, iOS and Android code.
69 lines
1.5 KiB
Plaintext
69 lines
1.5 KiB
Plaintext
/**
|
|
* Copyright (c) 2015-present, Horcrux.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the MIT-style license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
#import "RNSVGDefs.h"
|
|
|
|
#ifdef RN_FABRIC_ENABLED
|
|
#import <react/renderer/components/rnsvg/ComponentDescriptors.h>
|
|
#import <react/renderer/components/view/conversions.h>
|
|
#import "RCTConversions.h"
|
|
#import "RCTFabricComponentsPlugins.h"
|
|
#import "RNSVGFabricConversions.h"
|
|
#endif // RN_FABRIC_ENABLED
|
|
|
|
@implementation RNSVGDefs
|
|
|
|
#ifdef RN_FABRIC_ENABLED
|
|
using namespace facebook::react;
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
{
|
|
if (self = [super initWithFrame:frame]) {
|
|
static const auto defaultProps = std::make_shared<const RNSVGDefsProps>();
|
|
_props = defaultProps;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
#pragma mark - RCTComponentViewProtocol
|
|
|
|
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
{
|
|
return concreteComponentDescriptorProvider<RNSVGDefsComponentDescriptor>();
|
|
}
|
|
#endif // RN_FABRIC_ENABLED
|
|
|
|
- (void)renderTo:(CGContextRef)context
|
|
{
|
|
// Defs do not render
|
|
}
|
|
|
|
- (void)parseReference
|
|
{
|
|
self.dirty = false;
|
|
[self traverseSubviews:^(RNSVGNode *node) {
|
|
if ([node isKindOfClass:[RNSVGNode class]]) {
|
|
[node parseReference];
|
|
}
|
|
return YES;
|
|
}];
|
|
}
|
|
|
|
- (RNSVGPlatformView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
|
|
{
|
|
return nil;
|
|
}
|
|
|
|
@end
|
|
|
|
#ifdef RN_FABRIC_ENABLED
|
|
Class<RCTComponentViewProtocol> RNSVGDefsCls(void)
|
|
{
|
|
return RNSVGDefs.class;
|
|
}
|
|
#endif // RN_FABRIC_ENABLED
|