Skip to content

Commit 61b0693

Browse files
committed
fix(ios): crrectly stroke path for shader
1 parent a5b1b22 commit 61b0693

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/canvas.ios.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ export class Paint implements IPaint {
11531153
}
11541154
}
11551155

1156-
drawShader(ctx) {
1156+
drawShader(ctx, shouldStrkedPath = true) {
11571157
if (this.shader instanceof LinearGradient) {
11581158
const color = UIColor.clearColor;
11591159
CGContextSetFillColorWithColor(ctx, color.CGColor);
@@ -1162,7 +1162,7 @@ export class Paint implements IPaint {
11621162
const options = g.tileMode === TileMode.CLAMP ? CGGradientDrawingOptions.kCGGradientDrawsBeforeStartLocation | CGGradientDrawingOptions.kCGGradientDrawsAfterEndLocation : 0;
11631163
// const path = CGContextCopyPath(ctx);
11641164
CGContextSaveGState(ctx);
1165-
if (this.style === Style.STROKE) {
1165+
if (shouldStrkedPath && this.style === Style.STROKE) {
11661166
CGContextReplacePathWithStrokedPath(ctx);
11671167
}
11681168
CGContextClip(ctx);
@@ -1808,7 +1808,7 @@ export class Canvas implements ICanvas {
18081808
} else {
18091809
CGContextAddPath(ctx, path);
18101810
}
1811-
paint.drawShader(ctx);
1811+
paint.drawShader(ctx, false);
18121812
} else {
18131813
if (bPath) {
18141814
bPath.lineWidth = paint.strokeWidth;

0 commit comments

Comments
 (0)