Skip to content

Commit 242775a

Browse files
committed
fix eraser history
1 parent bdbb8e0 commit 242775a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-image-markup",
3-
"version": "3.0.4",
3+
"version": "3.0.5",
44
"description": "vue-image-markup will provide you to edit uploaded image easily and save it.",
55
"main": "src/Editor.vue",
66
"repository": {

src/Editor.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
this.cancelCroppingImage()
106106
},
107107
set(type, params) {
108-
this.canvas.off("mouse:down");
108+
this.canvas.off('mouse:down');
109109
switch (type) {
110110
case "text":
111111
this.currentActiveTool = type;
@@ -245,9 +245,12 @@
245245
case 'eraser':
246246
this.currentActiveTool = type;
247247
let inst = this;
248+
this.canvas.isDrawingMode = false;
249+
inst.selectable = true;
248250
this.canvas.on("mouse:down", function () {
249251
if (inst.canvas.getActiveObject()) {
250-
inst.canvas.remove(inst.canvas.getActiveObject())
252+
inst.canvas.remove(inst.canvas.getActiveObject());
253+
new CanvasHistory(inst.canvas)
251254
}
252255
});
253256
break;
@@ -467,6 +470,3 @@
467470
468471
}
469472
</script>
470-
<style>
471-
472-
</style>

0 commit comments

Comments
 (0)