mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-27 04:32:57 +00:00
Fix type warning.
This commit is contained in:
@@ -25,8 +25,8 @@
|
||||
@property (nonatomic, assign) CGLineCap strokeLinecap;
|
||||
@property (nonatomic, assign) CGLineJoin strokeLinejoin;
|
||||
@property (nonatomic, assign) CGFloat strokeMiterlimit;
|
||||
@property (nonatomic, assign) RNSVGCGFloatArray strokeDasharray;
|
||||
@property (nonatomic, assign) NSArray<NSString *> *strokeDasharrayData;
|
||||
@property (nonatomic, assign) RNSVGCGFloatArray strokeDasharrayData;
|
||||
@property (nonatomic, assign) NSArray<NSString *> *strokeDasharray;
|
||||
@property (nonatomic, assign) CGFloat strokeDashoffset;
|
||||
@property (nonatomic, copy) NSArray<NSString *> *propList;
|
||||
|
||||
|
||||
+11
-11
@@ -110,24 +110,24 @@
|
||||
|
||||
- (void)setStrokeDasharray:(NSArray<NSString *> *)strokeDasharray
|
||||
{
|
||||
if (strokeDasharray == _strokeDasharrayData) {
|
||||
if (strokeDasharray == _strokeDasharray) {
|
||||
return;
|
||||
}
|
||||
if (_strokeDasharray.array) {
|
||||
free(_strokeDasharray.array);
|
||||
if (_strokeDasharrayData.array) {
|
||||
free(_strokeDasharrayData.array);
|
||||
}
|
||||
[self invalidate];
|
||||
NSUInteger count = strokeDasharray.count;
|
||||
_strokeDasharray.count = count;
|
||||
_strokeDasharray.array = nil;
|
||||
_strokeDasharrayData.count = count;
|
||||
_strokeDasharrayData.array = nil;
|
||||
|
||||
if (count) {
|
||||
_strokeDasharray.array = malloc(sizeof(CGFloat) * count);
|
||||
_strokeDasharrayData.array = malloc(sizeof(CGFloat) * count);
|
||||
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
|
||||
@@ -152,8 +152,8 @@
|
||||
- (void)dealloc
|
||||
{
|
||||
CGPathRelease(_hitArea);
|
||||
if (_strokeDasharray.array) {
|
||||
free(_strokeDasharray.array);
|
||||
if (_strokeDasharrayData.array) {
|
||||
free(_strokeDasharrayData.array);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
CGContextSetLineWidth(context, [self.strokeWidth floatValue]);
|
||||
CGContextSetLineCap(context, self.strokeLinecap);
|
||||
CGContextSetLineJoin(context, self.strokeLinejoin);
|
||||
RNSVGCGFloatArray dash = self.strokeDasharray;
|
||||
RNSVGCGFloatArray dash = self.strokeDasharrayData;
|
||||
|
||||
if (dash.count) {
|
||||
CGContextSetLineDash(context, self.strokeDashoffset, dash.array, dash.count);
|
||||
|
||||
Reference in New Issue
Block a user