diff --git a/package.json b/package.json index 3c4b1f1..c980309 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-image-markup", - "version": "3.0.8", + "version": "3.0.9", "description": "vue-image-markup will provide you to edit uploaded image easily and save it.", "main": "src/Editor.vue", "repository": { diff --git a/src/Editor.vue b/src/Editor.vue index 887cdaa..8eafb40 100644 --- a/src/Editor.vue +++ b/src/Editor.vue @@ -50,7 +50,7 @@ new CanvasHistory(this.canvas, currentCanvas); }, methods: { - setBackgroundImage(imageUrl) { + setBackgroundImage(imageUrl, backgroundColor = "#fff") { let img = new Image(); this.toDataUrl(imageUrl, (dataUri) => { img.src = dataUri; @@ -86,6 +86,8 @@ }); inst.canvas.renderAll() } + inst.canvas.backgroundColor = backgroundColor; + inst.canvas.renderAll() } }); },