Skip to content

Commit 480ad38

Browse files
committed
fix(ios): canvas.drawPaint fix
1 parent 81b56e8 commit 480ad38

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ui-canvas/index.ios.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,8 +1402,11 @@ export class Canvas implements ICanvas {
14021402
drawPaint(paint: Paint): void {
14031403
// this.save();
14041404
const ctx = this.ctx;
1405-
CGContextFillRect(ctx, CGRectMake(0, 0, this.mWidth, this.mHeight));
1406-
paint.drawShader(ctx);
1405+
if (paint.shader) {
1406+
paint.drawShader(ctx);
1407+
} else {
1408+
CGContextFillRect(ctx, CGRectMake(0, 0, this.mWidth, this.mHeight));
1409+
}
14071410
// this.restore();
14081411
}
14091412

0 commit comments

Comments
 (0)