Skip to content

Commit

Permalink
Fixed undo/redo bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaex committed Dec 28, 2023
1 parent 692a9e6 commit 0f42fd1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1565,14 +1565,15 @@ public void RestoreState(ImageEditorMemento memento)

Shapes = memento.Shapes;

ClearTools();
DeselectCurrentShape();
MoveAll(Form.CanvasRectangle.X - memento.CanvasRectangle.X, Form.CanvasRectangle.Y - memento.CanvasRectangle.Y);

foreach (BaseEffectShape effect in EffectShapes)
{
effect.OnMoved();
}

ClearTools();
DeselectCurrentShape();
MoveAll(Form.CanvasRectangle.X - memento.CanvasRectangle.X, Form.CanvasRectangle.Y - memento.CanvasRectangle.Y);
OnImageModified();
UpdateMenu();
}
Expand Down

0 comments on commit 0f42fd1

Please sign in to comment.