saveDefinition => parseReference

This commit is contained in:
Horcrux
2017-02-04 11:18:10 +08:00
parent 00e1f69b1b
commit c91d333950
9 changed files with 21 additions and 11 deletions
+1 -1
View File
@@ -15,7 +15,7 @@
return nil;
}
- (void)saveDefinition
- (void)parseReference
{
[[self getSvgView] defineClipPath:self clipPathName:self.name];
}
+6 -1
View File
@@ -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;
}];
}
+2 -2
View File
@@ -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;
}];
}
+1 -1
View File
@@ -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];
+1 -1
View File
@@ -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];
+6 -1
View File
@@ -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];
}
}
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -214,7 +214,7 @@
return CGRectGetMinY([[self getSvgView] getContextBounds]);
}
- (void)saveDefinition
- (void)parseReference
{
if (self.name) {
RNSVGSvgView* svg = [self getSvgView];