Skip to content

Commit

Permalink
fix eraser history
Browse files Browse the repository at this point in the history
  • Loading branch information
GHarutyunyan committed Apr 14, 2020
1 parent bdbb8e0 commit 242775a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 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.4",
"version": "3.0.5",
"description": "vue-image-markup will provide you to edit uploaded image easily and save it.",
"main": "src/Editor.vue",
"repository": {
Expand Down
10 changes: 5 additions & 5 deletions src/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
this.cancelCroppingImage()
},
set(type, params) {
this.canvas.off("mouse:down");
this.canvas.off('mouse:down');
switch (type) {
case "text":
this.currentActiveTool = type;
Expand Down Expand Up @@ -245,9 +245,12 @@
case 'eraser':
this.currentActiveTool = type;
let inst = this;
this.canvas.isDrawingMode = false;
inst.selectable = true;
this.canvas.on("mouse:down", function () {
if (inst.canvas.getActiveObject()) {
inst.canvas.remove(inst.canvas.getActiveObject())
inst.canvas.remove(inst.canvas.getActiveObject());
new CanvasHistory(inst.canvas)
}
});
break;
Expand Down Expand Up @@ -467,6 +470,3 @@
}
</script>
<style>
</style>

0 comments on commit 242775a

Please sign in to comment.