mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-09 09:27:20 +00:00
refactor clipPath native code
refactor clipPath native code add strokeMiterlimit prop support
This commit is contained in:
@@ -31,12 +31,22 @@
|
||||
return;
|
||||
}
|
||||
|
||||
CGPathDrawingMode mode = kCGPathStroke;
|
||||
BOOL fillColor = YES;
|
||||
|
||||
// Add path to nodeArea
|
||||
CGPathAddPath(self.nodeArea, nil, _d);
|
||||
|
||||
if (self.stroke) {
|
||||
// Add stroke to nodeArea
|
||||
CGPathRef strokePath = CGPathCreateCopyByStrokingPath(_d, nil, self.strokeWidth, self.strokeLinecap, self.strokeLinejoin, self.strokeMiterlimit);
|
||||
CGPathAddPath(self.nodeArea, nil, strokePath);
|
||||
}
|
||||
|
||||
if (self.opacity == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
CGPathDrawingMode mode = kCGPathStroke;
|
||||
BOOL fillColor = YES;
|
||||
|
||||
if (self.fill) {
|
||||
mode = self.fillRule == kRNSVGCGFCRuleEvenodd ? kCGPathEOFill : kCGPathFill;
|
||||
fillColor = [self.fill applyFillColor:context];
|
||||
@@ -55,10 +65,6 @@
|
||||
}
|
||||
}
|
||||
if (self.stroke) {
|
||||
// Add stroke to nodeArea
|
||||
CGPathRef strokePath = CGPathCreateCopyByStrokingPath(_d, nil, self.strokeWidth, self.strokeLinecap, self.strokeLinejoin, 0);
|
||||
CGPathAddPath(self.nodeArea, nil, strokePath);
|
||||
|
||||
CGContextSetLineWidth(context, self.strokeWidth);
|
||||
CGContextSetLineCap(context, self.strokeLinecap);
|
||||
CGContextSetLineJoin(context, self.strokeLinejoin);
|
||||
|
||||
Reference in New Issue
Block a user