From b2c24bbc01e8c2015152a2c49aea659ba6936726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Sun, 28 Nov 2021 21:50:52 +0100 Subject: [PATCH 1/2] Trying to fix --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index bf0c122..68c7da6 100644 --- a/src/index.js +++ b/src/index.js @@ -197,7 +197,7 @@ export default class CanvasDraw extends PureComponent { if (!this.props.imgSrc) return "Background image source not set"; // Write the background image - this.drawImage(); + drawImage(); } else if (backgroundColour != null) { //set background color context.fillStyle = backgroundColour; From cf9d7e37711599b95bd88286417760a65feb9727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Sun, 28 Nov 2021 23:01:18 +0100 Subject: [PATCH 2/2] Trying to fix --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 68c7da6..806d088 100644 --- a/src/index.js +++ b/src/index.js @@ -197,7 +197,7 @@ export default class CanvasDraw extends PureComponent { if (!this.props.imgSrc) return "Background image source not set"; // Write the background image - drawImage(); + drawImage({ctx: context,img: this.props.imgSrc,x: 0,y: 0,w: this.props.canvasWidth, h: this.props.canvasHeight}); } else if (backgroundColour != null) { //set background color context.fillStyle = backgroundColour;