Fix type warning.

This commit is contained in:
Mikael Sand
2017-08-15 15:44:10 +03:00
parent 68eeb5e6da
commit 1c1e8a860b
2 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -25,8 +25,8 @@
@property (nonatomic, assign) CGLineCap strokeLinecap; @property (nonatomic, assign) CGLineCap strokeLinecap;
@property (nonatomic, assign) CGLineJoin strokeLinejoin; @property (nonatomic, assign) CGLineJoin strokeLinejoin;
@property (nonatomic, assign) CGFloat strokeMiterlimit; @property (nonatomic, assign) CGFloat strokeMiterlimit;
@property (nonatomic, assign) RNSVGCGFloatArray strokeDasharray; @property (nonatomic, assign) RNSVGCGFloatArray strokeDasharrayData;
@property (nonatomic, assign) NSArray<NSString *> *strokeDasharrayData; @property (nonatomic, assign) NSArray<NSString *> *strokeDasharray;
@property (nonatomic, assign) CGFloat strokeDashoffset; @property (nonatomic, assign) CGFloat strokeDashoffset;
@property (nonatomic, copy) NSArray<NSString *> *propList; @property (nonatomic, copy) NSArray<NSString *> *propList;
+11 -11
View File
@@ -110,24 +110,24 @@
- (void)setStrokeDasharray:(NSArray<NSString *> *)strokeDasharray - (void)setStrokeDasharray:(NSArray<NSString *> *)strokeDasharray
{ {
if (strokeDasharray == _strokeDasharrayData) { if (strokeDasharray == _strokeDasharray) {
return; return;
} }
if (_strokeDasharray.array) { if (_strokeDasharrayData.array) {
free(_strokeDasharray.array); free(_strokeDasharrayData.array);
} }
[self invalidate]; [self invalidate];
NSUInteger count = strokeDasharray.count; NSUInteger count = strokeDasharray.count;
_strokeDasharray.count = count; _strokeDasharrayData.count = count;
_strokeDasharray.array = nil; _strokeDasharrayData.array = nil;
if (count) { if (count) {
_strokeDasharray.array = malloc(sizeof(CGFloat) * count); _strokeDasharrayData.array = malloc(sizeof(CGFloat) * count);
for (NSUInteger i = 0; i < count; i++) { for (NSUInteger i = 0; i < count; i++) {
_strokeDasharray.array[i] = [strokeDasharray[i] floatValue]; _strokeDasharrayData.array[i] = [strokeDasharray[i] floatValue];
} }
} }
_strokeDasharrayData = strokeDasharray; _strokeDasharray = strokeDasharray;
} }
- (void)setStrokeDashoffset:(CGFloat)strokeDashoffset - (void)setStrokeDashoffset:(CGFloat)strokeDashoffset
@@ -152,8 +152,8 @@
- (void)dealloc - (void)dealloc
{ {
CGPathRelease(_hitArea); CGPathRelease(_hitArea);
if (_strokeDasharray.array) { if (_strokeDasharrayData.array) {
free(_strokeDasharray.array); free(_strokeDasharrayData.array);
} }
} }
@@ -216,7 +216,7 @@
CGContextSetLineWidth(context, [self.strokeWidth floatValue]); CGContextSetLineWidth(context, [self.strokeWidth floatValue]);
CGContextSetLineCap(context, self.strokeLinecap); CGContextSetLineCap(context, self.strokeLinecap);
CGContextSetLineJoin(context, self.strokeLinejoin); CGContextSetLineJoin(context, self.strokeLinejoin);
RNSVGCGFloatArray dash = self.strokeDasharray; RNSVGCGFloatArray dash = self.strokeDasharrayData;
if (dash.count) { if (dash.count) {
CGContextSetLineDash(context, self.strokeDashoffset, dash.array, dash.count); CGContextSetLineDash(context, self.strokeDashoffset, dash.array, dash.count);