mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-20 05:55:10 +00:00
38 lines
1.0 KiB
Objective-C
38 lines
1.0 KiB
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 "RNSVGPattern.h"
|
|
#import "RNSVGPainter.h"
|
|
#import "RNSVGBrushType.h"
|
|
#import "RNSVGNode.h"
|
|
|
|
@implementation RNSVGPattern
|
|
|
|
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
|
|
{
|
|
return nil;
|
|
}
|
|
|
|
- (void)parseReference
|
|
{
|
|
NSArray<NSString *> *points = @[self.x, self.y, self.patternwidth, self.patternheight];
|
|
RNSVGPainter *painter = [[RNSVGPainter alloc] initWithPointsArray:points];
|
|
[painter setUnits:self.patternUnits];
|
|
[painter setContentUnits:self.patternContentUnits];
|
|
[painter setTransform:self.patternTransform];
|
|
[painter setPattern:self];
|
|
|
|
if (self.patternUnits == kRNSVGUnitsUserSpaceOnUse || self.patternContentUnits == kRNSVGUnitsUserSpaceOnUse) {
|
|
[painter setUserSpaceBoundingBox:[self.svgView getContextBounds]];
|
|
}
|
|
|
|
[self.svgView definePainter:painter painterName:self.name];
|
|
}
|
|
|
|
@end
|
|
|