1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 01:29:49 +00:00

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
This commit is contained in:
Manolis Papadeas 2021-07-08 20:46:56 +03:00
parent 7b343cc30f
commit 2760049cfd
5 changed files with 11 additions and 0 deletions

View file

@ -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()

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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)