Skip to content

Commit 78f2e87

Browse files
author
Federico Fissore
committed
Undo and Redo state update were setting the sketch to modified, even if it was not. Fixes #2653
1 parent d1feeb5 commit 78f2e87

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

app/src/processing/app/Editor.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,6 +1365,7 @@ public UndoAction() {
13651365
public void actionPerformed(ActionEvent e) {
13661366
try {
13671367
undo.undo();
1368+
sketch.setModified(true);
13681369
} catch (CannotUndoException ex) {
13691370
//System.out.println("Unable to undo: " + ex);
13701371
//ex.printStackTrace();
@@ -1386,17 +1387,11 @@ protected void updateUndoState() {
13861387
undoItem.setEnabled(true);
13871388
undoItem.setText(undo.getUndoPresentationName());
13881389
putValue(Action.NAME, undo.getUndoPresentationName());
1389-
if (sketch != null) {
1390-
sketch.setModified(true); // 0107
1391-
}
13921390
} else {
13931391
this.setEnabled(false);
13941392
undoItem.setEnabled(false);
13951393
undoItem.setText(_("Undo"));
13961394
putValue(Action.NAME, "Undo");
1397-
if (sketch != null) {
1398-
sketch.setModified(false); // 0107
1399-
}
14001395
}
14011396
}
14021397
}
@@ -1411,6 +1406,7 @@ public RedoAction() {
14111406
public void actionPerformed(ActionEvent e) {
14121407
try {
14131408
undo.redo();
1409+
sketch.setModified(true);
14141410
} catch (CannotRedoException ex) {
14151411
//System.out.println("Unable to redo: " + ex);
14161412
//ex.printStackTrace();

0 commit comments

Comments
 (0)