From 21e2cd6bd0f8f4fa723e836575c9a7d15a991db5 Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 27 Jun 2021 18:15:06 +0300 Subject: [PATCH] Dragging and dropping frames to re-arrange them no longer makes selected_cels empty --- src/UI/Timeline/FrameButton.gd | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/UI/Timeline/FrameButton.gd b/src/UI/Timeline/FrameButton.gd index 2e2cb9bb7..bef5bbdc4 100644 --- a/src/UI/Timeline/FrameButton.gd +++ b/src/UI/Timeline/FrameButton.gd @@ -124,13 +124,16 @@ func drop_data(_pos, data) -> void: Global.current_project.undo_redo.create_action("Change Frame Order") Global.current_project.undo_redo.add_do_property(Global.current_project, "frames", new_frames) - - if Global.current_project.current_frame == frame: - Global.current_project.undo_redo.add_do_property(Global.current_project, "current_frame", new_frame) - Global.current_project.undo_redo.add_undo_property(Global.current_project, "current_frame", Global.current_project.current_frame) - Global.current_project.undo_redo.add_undo_property(Global.current_project, "frames", Global.current_project.frames) + if Global.current_project.current_frame == new_frame: + Global.current_project.undo_redo.add_do_property(Global.current_project, "current_frame", frame) + else: + Global.current_project.undo_redo.add_do_property(Global.current_project, "current_frame", Global.current_project.current_frame) + + Global.current_project.undo_redo.add_undo_property(Global.current_project, "current_frame", Global.current_project.current_frame) + + Global.current_project.undo_redo.add_undo_method(Global, "undo") Global.current_project.undo_redo.add_do_method(Global, "redo") Global.current_project.undo_redo.commit_action()