()
| 98 | } |
| 99 | |
| 100 | undoState() { |
| 101 | if (this.current.prev !== null) { |
| 102 | let currentToolName = this.current.activeToolName; |
| 103 | this.current = this.current.prev; |
| 104 | this.applyState(this.current); |
| 105 | this.changed(false); |
| 106 | if (currentToolName) { |
| 107 | this.main.closeActiveTool(true); |
| 108 | this.main.setActiveTool(this.main.toolByName[currentToolName]) |
| 109 | } else { |
| 110 | this.main.closeActiveTool(); |
| 111 | } |
| 112 | |
| 113 | if (this.main.params.onUndo) { |
| 114 | this.main.params.onUndo(this.current); |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | redoState() { |
| 120 | if (this.current.next !== null) { |
no test coverage detected