mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-08 17:15:04 +00:00
Fix brush fill with stroke
This commit is contained in:
+11
-4
@@ -213,15 +213,22 @@
|
|||||||
CGContextSetLineDash(context, self.strokeDashoffset, dash.array, dash.count);
|
CGContextSetLineDash(context, self.strokeDashoffset, dash.array, dash.count);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL strokeColor = [self.stroke applyStrokeColor:context opacity:self.strokeOpacity];
|
if (!fillColor) {
|
||||||
|
|
||||||
if (!fillColor || !strokeColor) {
|
|
||||||
CGContextAddPath(context, path);
|
CGContextAddPath(context, path);
|
||||||
CGContextReplacePathWithStrokedPath(context);
|
CGContextReplacePathWithStrokedPath(context);
|
||||||
CGContextClip(context);
|
CGContextClip(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strokeColor) {
|
if (![self.stroke applyStrokeColor:context opacity:self.strokeOpacity]) {
|
||||||
|
// draw fill
|
||||||
|
CGContextAddPath(context, path);
|
||||||
|
CGContextDrawPath(context, mode);
|
||||||
|
|
||||||
|
// draw stroke
|
||||||
|
CGContextAddPath(context, path);
|
||||||
|
CGContextReplacePathWithStrokedPath(context);
|
||||||
|
CGContextClip(context);
|
||||||
|
|
||||||
[self.stroke paint:context
|
[self.stroke paint:context
|
||||||
opacity:self.strokeOpacity
|
opacity:self.strokeOpacity
|
||||||
brushConverter:[[self getSvgView] getDefinedBrushConverter:self.stroke.brushRef]
|
brushConverter:[[self getSvgView] getDefinedBrushConverter:self.stroke.brushRef]
|
||||||
|
|||||||
Reference in New Issue
Block a user