mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-01 14:15:03 +00:00
43 lines
986 B
Objective-C
43 lines
986 B
Objective-C
/**
|
|
* 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 "RNSVGRadialGradient.h"
|
|
|
|
@implementation RNSVGRadialGradient
|
|
|
|
- (void)setGradient:(NSArray<NSNumber *> *)gradient
|
|
{
|
|
if (gradient == _gradient) {
|
|
return;
|
|
}
|
|
|
|
_gradient = gradient;
|
|
[self invalidate];
|
|
}
|
|
|
|
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
|
|
{
|
|
return nil;
|
|
}
|
|
|
|
- (void)saveDefination:(CGContextRef)context
|
|
{
|
|
RNSVGBrushConverter *converter = [[RNSVGBrushConverter alloc] init];
|
|
converter.colors = self.gradient;
|
|
converter.points = @[self.fx, self.fy, self.rx, self.ry, self.cx, self.cy];
|
|
converter.type = kRNSVGRadialGradient;
|
|
[[self getSvgView] defineBrushConverter:converter brushConverterRef:self.name];
|
|
}
|
|
|
|
- (void)removeDefination
|
|
{
|
|
[[self getSvgView] removeBrushConverter:self.name];
|
|
}
|
|
|
|
@end
|
|
|