mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-02 23:02:16 +00:00
saveDefinition => parseReference
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)saveDefinition
|
||||
- (void)parseReference
|
||||
{
|
||||
[[self getSvgView] defineClipPath:self clipPathName:self.name];
|
||||
}
|
||||
|
||||
@@ -12,9 +12,14 @@
|
||||
@implementation RNSVGDefs
|
||||
|
||||
- (void)renderTo:(CGContextRef)context
|
||||
{
|
||||
// Defs do not render
|
||||
}
|
||||
|
||||
- (void)parseReference
|
||||
{
|
||||
[self traverseSubviews:^(RNSVGNode *node) {
|
||||
[node saveDefinition];
|
||||
[node parseReference];
|
||||
return YES;
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)saveDefinition
|
||||
- (void)parseReference
|
||||
{
|
||||
if (self.name) {
|
||||
RNSVGSvgView* svg = [self getSvgView];
|
||||
@@ -105,7 +105,7 @@
|
||||
}
|
||||
|
||||
[self traverseSubviews:^(__kindof RNSVGNode *node) {
|
||||
[node saveDefinition];
|
||||
[node parseReference];
|
||||
return YES;
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)saveDefinition
|
||||
- (void)parseReference
|
||||
{
|
||||
NSArray<NSString *> *points = @[self.x1, self.y1, self.x2, self.y2];
|
||||
RNSVGPainter *painter = [[RNSVGPainter alloc] initWithPointsArray:points];
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)saveDefinition
|
||||
- (void)parseReference
|
||||
{
|
||||
NSArray<NSString *> *points = @[self.fx, self.fy, self.rx, self.ry, self.cx, self.cy];
|
||||
RNSVGPainter *painter = [[RNSVGPainter alloc] initWithPointsArray:points];
|
||||
|
||||
@@ -126,7 +126,12 @@
|
||||
self.responsible = YES;
|
||||
}
|
||||
|
||||
[node saveDefinition];
|
||||
[node parseReference];
|
||||
}
|
||||
}
|
||||
|
||||
for (RNSVGNode *node in self.subviews) {
|
||||
if ([node isKindOfClass:[RNSVGNode class]]) {
|
||||
[node renderTo:context];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
- (void)renderTo:(CGContextRef)context
|
||||
{
|
||||
[self saveDefinition];
|
||||
// Do not render Symbol
|
||||
}
|
||||
|
||||
- (void)renderSymbolTo:(CGContextRef)context width:(CGFloat)width height:(CGFloat)height
|
||||
|
||||
+2
-2
@@ -79,9 +79,9 @@
|
||||
- (CGFloat)getContextTop;
|
||||
|
||||
/**
|
||||
* save element`s defination into svg element.
|
||||
* save element`s reference into svg element.
|
||||
*/
|
||||
- (void)saveDefinition;
|
||||
- (void)parseReference;
|
||||
|
||||
- (void)beginTransparencyLayer:(CGContextRef)context;
|
||||
|
||||
|
||||
+1
-1
@@ -214,7 +214,7 @@
|
||||
return CGRectGetMinY([[self getSvgView] getContextBounds]);
|
||||
}
|
||||
|
||||
- (void)saveDefinition
|
||||
- (void)parseReference
|
||||
{
|
||||
if (self.name) {
|
||||
RNSVGSvgView* svg = [self getSvgView];
|
||||
|
||||
Reference in New Issue
Block a user