Skip to content

Commit

Permalink
Fix undo of widget addition
Browse files Browse the repository at this point in the history
  • Loading branch information
ObaraEmmanuel committed Sep 20, 2023
1 parent b5cf2da commit ba717ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions studio/feature/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,8 @@ def add(self, obj_class: PseudoWidget.__class__, x, y, **kwargs):
if not silent:
self.studio.new_action(Action(
# Delete silently to prevent adding the event to the undo/redo stack
lambda _: self.delete(obj, True),
lambda _: self.restore(obj, restore_point, obj.layout)
lambda _: self.delete([obj], True),
lambda _: self.restore([obj], [restore_point], [obj.layout])
))
elif obj.layout is None:
# This only happens when adding the main layout. We dont need to add this action to the undo/redo stack
Expand Down

0 comments on commit ba717ab

Please sign in to comment.