mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-01 06:07:41 +00:00
Fix ios/objective-c types and errors/red boxes.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
@interface RNSVGGlyphContext : NSObject
|
||||
|
||||
- (instancetype)initWithDimensions:(CGFloat)width height:(CGFloat)height;
|
||||
- (void)pushContext:(NSDictionary *)font deltaX:(NSArray<NSNumber *> *)deltaX deltaY:(NSArray<NSNumber *> *)deltaY positionX:(NSString *)positionX positionY:(NSString *)positionY;
|
||||
- (void)pushContext:(NSDictionary *)font deltaX:(NSArray<NSString *> *)deltaX deltaY:(NSArray<NSString *> *)deltaY positionX:(NSArray<NSString *> *)positionX positionY:(NSArray<NSString *> *)positionY;
|
||||
- (void)popContext;
|
||||
- (CTFontRef)getGlyphFont;
|
||||
- (CGPoint)getNextGlyphPoint:(CGPoint)offset glyphWidth:(CGFloat)glyphWidth;
|
||||
|
||||
@@ -38,16 +38,16 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)pushContext:(NSDictionary *)font deltaX:(NSArray<NSNumber *> *)deltaX deltaY:(NSArray<NSNumber *> *)deltaY positionX:(NSString *)positionX positionY:(NSString *)positionY
|
||||
- (void)pushContext:(NSDictionary *)font deltaX:(NSArray<NSString *> *)deltaX deltaY:(NSArray<NSString *> *)deltaY positionX:(NSArray<NSString *> *)positionX positionY:(NSArray<NSString *> *)positionY
|
||||
{
|
||||
CGPoint location = _currentLocation;
|
||||
|
||||
if (positionX) {
|
||||
location.x = [RNSVGPercentageConverter stringToFloat:positionX relative:_width offset:0];
|
||||
location.x = [RNSVGPercentageConverter stringToFloat:[positionX firstObject] relative:_width offset:0];
|
||||
}
|
||||
|
||||
if (positionY) {
|
||||
location.y = [RNSVGPercentageConverter stringToFloat:positionY relative:_height offset:0];
|
||||
location.y = [RNSVGPercentageConverter stringToFloat:[positionY firstObject] relative:_height offset:0];
|
||||
}
|
||||
|
||||
[_locationContext addObject:[NSValue valueWithCGPoint:location]];
|
||||
@@ -127,6 +127,8 @@
|
||||
NSNumber *fontSize;
|
||||
NSString *fontWeight;
|
||||
NSString *fontStyle;
|
||||
NSNumberFormatter *f = [[NSNumberFormatter alloc] init];
|
||||
f.numberStyle = NSNumberFormatterDecimalStyle;
|
||||
|
||||
for (NSDictionary *font in [_fontContext reverseObjectEnumerator]) {
|
||||
if (!fontFamily) {
|
||||
@@ -134,7 +136,7 @@
|
||||
}
|
||||
|
||||
if (fontSize == nil) {
|
||||
fontSize = font[@"fontSize"];
|
||||
fontSize = [f numberFromString:font[@"fontSize"]];
|
||||
}
|
||||
|
||||
if (!fontWeight) {
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
@interface RNSVGText : RNSVGGroup
|
||||
|
||||
@property (nonatomic, assign) RNSVGTextAnchor textAnchor;
|
||||
@property (nonatomic, strong) NSArray<NSNumber *> *deltaX;
|
||||
@property (nonatomic, strong) NSArray<NSNumber *> *deltaY;
|
||||
@property (nonatomic, strong) NSString *positionX;
|
||||
@property (nonatomic, strong) NSString *positionY;
|
||||
@property (nonatomic, strong) NSArray<NSString *> *deltaX;
|
||||
@property (nonatomic, strong) NSArray<NSString *> *deltaY;
|
||||
@property (nonatomic, strong) NSArray<NSString *> *positionX;
|
||||
@property (nonatomic, strong) NSArray<NSString *> *positionY;
|
||||
@property (nonatomic, strong) NSDictionary *font;
|
||||
|
||||
- (RNSVGText *)getTextRoot;
|
||||
|
||||
Reference in New Issue
Block a user