mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-08 09:10:44 +00:00
[ios] Fix substring range length calculation for unicode emoji.
This commit is contained in:
@@ -815,7 +815,8 @@ static double RNSVGTSpan_radToDeg = 180 / M_PI;
|
||||
if (width == 0) { // Render unicode emoji
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
CFIndex startIndex = indices[g];
|
||||
NSString* currChars = [str substringWithRange:NSMakeRange(startIndex, MAX(1, endIndex - startIndex))];
|
||||
NSUInteger len = endIndex == startIndex ? n - startIndex : MAX(1, endIndex - startIndex);
|
||||
NSString* currChars = [str substringWithRange:NSMakeRange(startIndex, len)];
|
||||
label.text = currChars;
|
||||
label.opaque = NO;
|
||||
label.backgroundColor = UIColor.clearColor;
|
||||
|
||||
Reference in New Issue
Block a user