mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-08 09:10:44 +00:00
[ios] Harmonize setupTextPath with android
This commit is contained in:
+9
-11
@@ -874,24 +874,22 @@ static double RNSVGTSpan_radToDeg = 180 / M_PI;
|
||||
lines = nil;
|
||||
lengths = nil;
|
||||
textPath = nil;
|
||||
RNSVGText *targetView = self;
|
||||
RNSVGText *parent = (RNSVGText*)[self superview];
|
||||
|
||||
while (targetView && [targetView class] != [RNSVGText class]) {
|
||||
if (![targetView isKindOfClass:[RNSVGText class]]) {
|
||||
//todo: throw exception here
|
||||
return;
|
||||
}
|
||||
|
||||
targetView = (RNSVGText*)[targetView superview];
|
||||
if ([targetView class] == [RNSVGTextPath class]) {
|
||||
textPath = (RNSVGTextPath*) targetView;
|
||||
while (parent) {
|
||||
if ([parent class] == [RNSVGTextPath class]) {
|
||||
textPath = (RNSVGTextPath*) parent;
|
||||
[textPath getPathLength:&_pathLength
|
||||
lineCount:&lineCount
|
||||
lengths:&lengths
|
||||
lines:&lines
|
||||
isClosed:&isClosed];
|
||||
return;
|
||||
break;
|
||||
} else if (![parent isKindOfClass:[RNSVGText class]]) {
|
||||
break;
|
||||
}
|
||||
|
||||
parent = (RNSVGText*)[parent superview];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user