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:
parent
7b343cc30f
commit
2760049cfd
|
@ -387,6 +387,7 @@ func size_changed(value : Vector2) -> void:
|
||||||
|
|
||||||
|
|
||||||
func frames_changed(value : Array) -> void:
|
func frames_changed(value : Array) -> void:
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
frames = value
|
frames = value
|
||||||
selected_cels.clear()
|
selected_cels.clear()
|
||||||
remove_cel_buttons()
|
remove_cel_buttons()
|
||||||
|
|
|
@ -161,6 +161,7 @@ func _on_DeleteFrame_pressed(frame := -1) -> void:
|
||||||
|
|
||||||
|
|
||||||
func _on_CopyFrame_pressed(frame := -1) -> void:
|
func _on_CopyFrame_pressed(frame := -1) -> void:
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
if frame == -1:
|
if frame == -1:
|
||||||
frame = Global.current_project.current_frame
|
frame = Global.current_project.current_frame
|
||||||
|
|
||||||
|
@ -272,6 +273,7 @@ func _on_AnimationTimer_timeout() -> void:
|
||||||
$AnimationTimer.stop()
|
$AnimationTimer.stop()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
var fps = Global.current_project.fps
|
var fps = Global.current_project.fps
|
||||||
if animation_forward:
|
if animation_forward:
|
||||||
if Global.current_project.current_frame < last_frame:
|
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:
|
func _on_NextFrame_pressed() -> void:
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
Global.current_project.selected_cels.clear()
|
Global.current_project.selected_cels.clear()
|
||||||
if Global.current_project.current_frame < Global.current_project.frames.size() - 1:
|
if Global.current_project.current_frame < Global.current_project.frames.size() - 1:
|
||||||
Global.current_project.current_frame += 1
|
Global.current_project.current_frame += 1
|
||||||
|
|
||||||
|
|
||||||
func _on_PreviousFrame_pressed() -> void:
|
func _on_PreviousFrame_pressed() -> void:
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
Global.current_project.selected_cels.clear()
|
Global.current_project.selected_cels.clear()
|
||||||
if Global.current_project.current_frame > 0:
|
if Global.current_project.current_frame > 0:
|
||||||
Global.current_project.current_frame -= 1
|
Global.current_project.current_frame -= 1
|
||||||
|
|
||||||
|
|
||||||
func _on_LastFrame_pressed() -> void:
|
func _on_LastFrame_pressed() -> void:
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
Global.current_project.selected_cels.clear()
|
Global.current_project.selected_cels.clear()
|
||||||
Global.current_project.current_frame = Global.current_project.frames.size() - 1
|
Global.current_project.current_frame = Global.current_project.frames.size() - 1
|
||||||
|
|
||||||
|
|
||||||
func _on_FirstFrame_pressed() -> void:
|
func _on_FirstFrame_pressed() -> void:
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
Global.current_project.selected_cels.clear()
|
Global.current_project.selected_cels.clear()
|
||||||
Global.current_project.current_frame = 0
|
Global.current_project.current_frame = 0
|
||||||
|
|
||||||
|
@ -399,6 +405,7 @@ func _on_BlueRedMode_toggled(button_pressed : bool) -> void:
|
||||||
# Layer buttons
|
# Layer buttons
|
||||||
|
|
||||||
func add_layer(is_new := true) -> void:
|
func add_layer(is_new := true) -> void:
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
var new_layers : Array = Global.current_project.layers.duplicate()
|
var new_layers : Array = Global.current_project.layers.duplicate()
|
||||||
var l := Layer.new()
|
var l := Layer.new()
|
||||||
if !is_new: # Clone layer
|
if !is_new: # Clone layer
|
||||||
|
|
|
@ -45,6 +45,7 @@ func _on_CelButton_resized() -> void:
|
||||||
func _on_CelButton_pressed() -> void:
|
func _on_CelButton_pressed() -> void:
|
||||||
var project := Global.current_project
|
var project := Global.current_project
|
||||||
if Input.is_action_just_released("left_mouse"):
|
if Input.is_action_just_released("left_mouse"):
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
var change_cel := true
|
var change_cel := true
|
||||||
var prev_curr_frame : int = project.current_frame
|
var prev_curr_frame : int = project.current_frame
|
||||||
var prev_curr_layer : int = project.current_layer
|
var prev_curr_layer : int = project.current_layer
|
||||||
|
|
|
@ -12,6 +12,7 @@ func _ready() -> void:
|
||||||
|
|
||||||
func _button_pressed() -> void:
|
func _button_pressed() -> void:
|
||||||
if Input.is_action_just_released("left_mouse"):
|
if Input.is_action_just_released("left_mouse"):
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
var prev_curr_frame : int = Global.current_project.current_frame
|
var prev_curr_frame : int = Global.current_project.current_frame
|
||||||
if Input.is_action_pressed("shift"):
|
if Input.is_action_pressed("shift"):
|
||||||
var frame_diff_sign = sign(frame - prev_curr_frame)
|
var frame_diff_sign = sign(frame - prev_curr_frame)
|
||||||
|
|
|
@ -49,6 +49,7 @@ func _on_LayerContainer_gui_input(event : InputEvent) -> void:
|
||||||
var project := Global.current_project
|
var project := Global.current_project
|
||||||
|
|
||||||
if event is InputEventMouseButton:
|
if event is InputEventMouseButton:
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
var prev_curr_layer : int = project.current_layer
|
var prev_curr_layer : int = project.current_layer
|
||||||
if Input.is_action_pressed("shift"):
|
if Input.is_action_pressed("shift"):
|
||||||
var layer_diff_sign = sign(layer - prev_curr_layer)
|
var layer_diff_sign = sign(layer - prev_curr_layer)
|
||||||
|
|
Loading…
Reference in a new issue