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:
parent
605e7ab3fd
commit
04dda09df5
|
@ -92,7 +92,7 @@ func _on_CelButton_pressed() -> void:
|
||||||
pressed = !pressed
|
pressed = !pressed
|
||||||
elif Input.is_action_just_released("middle_mouse"):
|
elif Input.is_action_just_released("middle_mouse"):
|
||||||
pressed = !pressed
|
pressed = !pressed
|
||||||
delete_cel_contents()
|
_delete_cel_content()
|
||||||
else: # An example of this would be Space
|
else: # An example of this would be Space
|
||||||
pressed = !pressed
|
pressed = !pressed
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ func _on_CelButton_pressed() -> void:
|
||||||
func _on_PopupMenu_id_pressed(id: int) -> void:
|
func _on_PopupMenu_id_pressed(id: int) -> void:
|
||||||
match id:
|
match id:
|
||||||
MenuOptions.DELETE:
|
MenuOptions.DELETE:
|
||||||
delete_cel_contents()
|
_delete_cel_content()
|
||||||
|
|
||||||
MenuOptions.LINK:
|
MenuOptions.LINK:
|
||||||
var f: Frame = Global.current_project.frames[frame]
|
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()
|
Global.current_project.undo_redo.commit_action()
|
||||||
|
|
||||||
|
|
||||||
func delete_cel_contents() -> void:
|
func _delete_cel_content() -> void:
|
||||||
if image.is_invisible():
|
if image.is_invisible():
|
||||||
return
|
return
|
||||||
|
var curr_layer: Layer = Global.current_project.layers[layer]
|
||||||
|
if !curr_layer.can_layer_get_drawn():
|
||||||
|
return
|
||||||
var project = Global.current_project
|
var project = Global.current_project
|
||||||
image.unlock()
|
image.unlock()
|
||||||
var data := image.data
|
var data := image.data
|
||||||
|
|
Loading…
Reference in a new issue