This commit is contained in:
hneemann 2019-08-21 21:13:12 +02:00
parent 0279e2bb9b
commit 989b47aba5

View File

@ -460,11 +460,15 @@ public class CircuitComponent extends JComponent implements ChangedListener, Lib
* undo last action
*/
private void undo() {
if (!isLocked() && undoManager.undoAvailable()) {
try {
undoManager.undo();
} catch (ModifyException e) {
throw new RuntimeException("internal error in undo", e);
if (activeMouseController != mouseNormal)
activeMouseController.escapePressed();
else {
if (!isLocked() && undoManager.undoAvailable()) {
try {
undoManager.undo();
} catch (ModifyException e) {
throw new RuntimeException("internal error in undo", e);
}
}
}
}
@ -481,6 +485,7 @@ public class CircuitComponent extends JComponent implements ChangedListener, Lib
*/
private void redo() {
if (!isLocked() && undoManager.redoAvailable()) {
activeMouseController.escapePressed();
try {
undoManager.redo();
} catch (ModifyException e) {