diff --git a/src/render/canvas/canvas-renderer.ts b/src/render/canvas/canvas-renderer.ts index 60bc3ab..c49b6d6 100644 --- a/src/render/canvas/canvas-renderer.ts +++ b/src/render/canvas/canvas-renderer.ts @@ -603,7 +603,7 @@ export class CanvasRenderer extends Renderer { ]); const pattern = this.ctx.createPattern( this.resizeImage(image, width, height), - repeatTypes[+container.styles.backgroundRepeat] + repeatTypes[+container.styles.backgroundRepeat || 0] ) as CanvasPattern; this.renderRepeat(path, pattern, x, y); } @@ -626,7 +626,7 @@ export class CanvasRenderer extends Renderer { if (width > 0 && height > 0) { const pattern = this.ctx.createPattern( canvas, - repeatTypes[+container.styles.backgroundRepeat] + repeatTypes[+container.styles.backgroundRepeat || 0] ) as CanvasPattern; this.renderRepeat(path, pattern, x, y); }