File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
ios/RNSketchCanvas/RNSketchCanvas Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -74,16 +74,19 @@ - (UIView *)view
74
74
75
75
RCT_EXPORT_METHOD (addPath:(nonnull NSNumber *)reactTag pathId: (int ) pathId strokeColor: (UIColor*) strokeColor strokeWidth: (int ) strokeWidth points: (NSArray *) points)
76
76
{
77
- NSMutableArray *cgPoints = [[NSMutableArray alloc ] initWithCapacity: points.count];
77
+ NSMutableArray *cgPoints = [[NSMutableArray alloc ] initWithCapacity: points.count];
78
+
78
79
for (NSString *coor in points) {
79
80
@autoreleasepool {
80
- NSArray *coorInNumber = [coor componentsSeparatedByString: @" ," ];
81
- [cgPoints addObject: [NSValue valueWithCGPoint: CGPointMake ([coorInNumber[0 ] floatValue ], [coorInNumber[1 ] floatValue ])]];
82
- [self runCanvas: reactTag block: ^(RNSketchCanvas *canvas) {
83
- [canvas addPath: pathId strokeColor: strokeColor strokeWidth: strokeWidth points: cgPoints];
84
- }];
81
+ NSArray *coorInNumber = [coor componentsSeparatedByString: @" ," ];
82
+ CGPoint point = CGPointMake ([coorInNumber[0 ] floatValue ], [coorInNumber[1 ] floatValue ]);
83
+ [cgPoints addObject: [NSValue valueWithCGPoint: point]];
85
84
}
86
85
}
86
+
87
+ [self runCanvas: reactTag block: ^(RNSketchCanvas *canvas) {
88
+ [canvas addPath: pathId strokeColor: strokeColor strokeWidth: strokeWidth points: cgPoints];
89
+ }];
87
90
}
88
91
89
92
RCT_EXPORT_METHOD (newPath:(nonnull NSNumber *)reactTag pathId: (int ) pathId strokeColor: (UIColor*) strokeColor strokeWidth: (int ) strokeWidth)
You can’t perform that action at this time.
0 commit comments