Fix brush fill with stroke

This commit is contained in:
Horcrux
2017-01-13 16:47:25 +08:00
parent 3069f9408a
commit b19a7d144f
+11 -4
View File
@@ -213,15 +213,22 @@
CGContextSetLineDash(context, self.strokeDashoffset, dash.array, dash.count);
}
BOOL strokeColor = [self.stroke applyStrokeColor:context opacity:self.strokeOpacity];
if (!fillColor || !strokeColor) {
if (!fillColor) {
CGContextAddPath(context, path);
CGContextReplacePathWithStrokedPath(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
opacity:self.strokeOpacity
brushConverter:[[self getSvgView] getDefinedBrushConverter:self.stroke.brushRef]