/** * 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 *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