Skip to content

Commit

Permalink
add background color property on setBackgroundImage() function
Browse files Browse the repository at this point in the history
  • Loading branch information
GHarutyunyan committed Apr 20, 2020
1 parent f2246b6 commit f3c3966
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 3 additions & 1 deletion src/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -86,6 +86,8 @@
});
inst.canvas.renderAll()
}
inst.canvas.backgroundColor = backgroundColor;
inst.canvas.renderAll()
}
});
},
Expand Down

0 comments on commit f3c3966

Please sign in to comment.