From 2760049cfd2d8ae1f001087610cc11a31ebb34b2 Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Thu, 8 Jul 2021 20:46:56 +0300 Subject: [PATCH] Fix content transformation not getting confirmed when changes were done to frames and layers Also fixes issue where frame/layer copying does not copy the transformed data --- src/Classes/Project.gd | 1 + src/UI/Timeline/AnimationTimeline.gd | 7 +++++++ src/UI/Timeline/CelButton.gd | 1 + src/UI/Timeline/FrameButton.gd | 1 + src/UI/Timeline/LayerButton.gd | 1 + 5 files changed, 11 insertions(+) diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index c215ec5b1..3d3112006 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -387,6 +387,7 @@ func size_changed(value : Vector2) -> void: func frames_changed(value : Array) -> void: + Global.canvas.selection.transform_content_confirm() frames = value selected_cels.clear() remove_cel_buttons() diff --git a/src/UI/Timeline/AnimationTimeline.gd b/src/UI/Timeline/AnimationTimeline.gd index 08309e694..6380c2b62 100644 --- a/src/UI/Timeline/AnimationTimeline.gd +++ b/src/UI/Timeline/AnimationTimeline.gd @@ -161,6 +161,7 @@ func _on_DeleteFrame_pressed(frame := -1) -> void: func _on_CopyFrame_pressed(frame := -1) -> void: + Global.canvas.selection.transform_content_confirm() if frame == -1: frame = Global.current_project.current_frame @@ -272,6 +273,7 @@ func _on_AnimationTimer_timeout() -> void: $AnimationTimer.stop() return + Global.canvas.selection.transform_content_confirm() var fps = Global.current_project.fps if animation_forward: if Global.current_project.current_frame < last_frame: @@ -355,23 +357,27 @@ func play_animation(play : bool, forward_dir : bool) -> void: func _on_NextFrame_pressed() -> void: + Global.canvas.selection.transform_content_confirm() Global.current_project.selected_cels.clear() if Global.current_project.current_frame < Global.current_project.frames.size() - 1: Global.current_project.current_frame += 1 func _on_PreviousFrame_pressed() -> void: + Global.canvas.selection.transform_content_confirm() Global.current_project.selected_cels.clear() if Global.current_project.current_frame > 0: Global.current_project.current_frame -= 1 func _on_LastFrame_pressed() -> void: + Global.canvas.selection.transform_content_confirm() Global.current_project.selected_cels.clear() Global.current_project.current_frame = Global.current_project.frames.size() - 1 func _on_FirstFrame_pressed() -> void: + Global.canvas.selection.transform_content_confirm() Global.current_project.selected_cels.clear() Global.current_project.current_frame = 0 @@ -399,6 +405,7 @@ func _on_BlueRedMode_toggled(button_pressed : bool) -> void: # Layer buttons func add_layer(is_new := true) -> void: + Global.canvas.selection.transform_content_confirm() var new_layers : Array = Global.current_project.layers.duplicate() var l := Layer.new() if !is_new: # Clone layer diff --git a/src/UI/Timeline/CelButton.gd b/src/UI/Timeline/CelButton.gd index e74372ba0..c2bb69a78 100644 --- a/src/UI/Timeline/CelButton.gd +++ b/src/UI/Timeline/CelButton.gd @@ -45,6 +45,7 @@ func _on_CelButton_resized() -> void: func _on_CelButton_pressed() -> void: var project := Global.current_project if Input.is_action_just_released("left_mouse"): + Global.canvas.selection.transform_content_confirm() var change_cel := true var prev_curr_frame : int = project.current_frame var prev_curr_layer : int = project.current_layer diff --git a/src/UI/Timeline/FrameButton.gd b/src/UI/Timeline/FrameButton.gd index bef5bbdc4..b0d27b8da 100644 --- a/src/UI/Timeline/FrameButton.gd +++ b/src/UI/Timeline/FrameButton.gd @@ -12,6 +12,7 @@ func _ready() -> void: func _button_pressed() -> void: if Input.is_action_just_released("left_mouse"): + Global.canvas.selection.transform_content_confirm() var prev_curr_frame : int = Global.current_project.current_frame if Input.is_action_pressed("shift"): var frame_diff_sign = sign(frame - prev_curr_frame) diff --git a/src/UI/Timeline/LayerButton.gd b/src/UI/Timeline/LayerButton.gd index f339ffa39..1a010b5c2 100644 --- a/src/UI/Timeline/LayerButton.gd +++ b/src/UI/Timeline/LayerButton.gd @@ -49,6 +49,7 @@ func _on_LayerContainer_gui_input(event : InputEvent) -> void: var project := Global.current_project if event is InputEventMouseButton: + Global.canvas.selection.transform_content_confirm() var prev_curr_layer : int = project.current_layer if Input.is_action_pressed("shift"): var layer_diff_sign = sign(layer - prev_curr_layer)