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

Do not delete cel content if the layer is locked/invisible

This commit is contained in:
Manolis Papadeas 2022-01-01 04:12:49 +02:00
parent 605e7ab3fd
commit 04dda09df5

View file

@ -92,7 +92,7 @@ func _on_CelButton_pressed() -> void:
pressed = !pressed
elif Input.is_action_just_released("middle_mouse"):
pressed = !pressed
delete_cel_contents()
_delete_cel_content()
else: # An example of this would be Space
pressed = !pressed
@ -100,7 +100,7 @@ func _on_CelButton_pressed() -> void:
func _on_PopupMenu_id_pressed(id: int) -> void:
match id:
MenuOptions.DELETE:
delete_cel_contents()
_delete_cel_content()
MenuOptions.LINK:
var f: Frame = Global.current_project.frames[frame]
@ -157,9 +157,12 @@ func _on_PopupMenu_id_pressed(id: int) -> void:
Global.current_project.undo_redo.commit_action()
func delete_cel_contents() -> void:
func _delete_cel_content() -> void:
if image.is_invisible():
return
var curr_layer: Layer = Global.current_project.layers[layer]
if !curr_layer.can_layer_get_drawn():
return
var project = Global.current_project
image.unlock()
var data := image.data