js-draw 0.11.1 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/dist/bundle.js +1 -1
- package/dist/src/tools/Eraser.js +2 -0
- package/package.json +1 -1
- package/src/tools/Eraser.ts +2 -0
package/dist/src/tools/Eraser.js
CHANGED
@@ -39,11 +39,13 @@ export default class Eraser extends BaseTool {
|
|
39
39
|
if (this.toRemove.length > 0) {
|
40
40
|
// Undo commands for each individual component and unite into a single command.
|
41
41
|
this.partialCommands.forEach(cmd => cmd.unapply(this.editor));
|
42
|
+
this.partialCommands = [];
|
42
43
|
const command = new Erase(this.toRemove);
|
43
44
|
this.editor.dispatch(command); // dispatch: Makes undo-able.
|
44
45
|
}
|
45
46
|
}
|
46
47
|
onGestureCancel() {
|
47
48
|
this.partialCommands.forEach(cmd => cmd.unapply(this.editor));
|
49
|
+
this.partialCommands = [];
|
48
50
|
}
|
49
51
|
}
|
package/package.json
CHANGED
package/src/tools/Eraser.ts
CHANGED
@@ -57,6 +57,7 @@ export default class Eraser extends BaseTool {
|
|
57
57
|
if (this.toRemove.length > 0) {
|
58
58
|
// Undo commands for each individual component and unite into a single command.
|
59
59
|
this.partialCommands.forEach(cmd => cmd.unapply(this.editor));
|
60
|
+
this.partialCommands = [];
|
60
61
|
|
61
62
|
const command = new Erase(this.toRemove);
|
62
63
|
this.editor.dispatch(command); // dispatch: Makes undo-able.
|
@@ -65,5 +66,6 @@ export default class Eraser extends BaseTool {
|
|
65
66
|
|
66
67
|
public onGestureCancel(): void {
|
67
68
|
this.partialCommands.forEach(cmd => cmd.unapply(this.editor));
|
69
|
+
this.partialCommands = [];
|
68
70
|
}
|
69
71
|
}
|