mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-22 13:33:13 +00:00
Fixed crash when removing the first layer
Global.current_layer was being set to -1
This commit is contained in:
parent
0619d0e1ad
commit
321ac978f1
1 changed files with 4 additions and 1 deletions
|
@ -183,7 +183,10 @@ func _on_RemoveLayer_pressed() -> void:
|
||||||
new_layers.remove(Global.current_layer)
|
new_layers.remove(Global.current_layer)
|
||||||
Global.undos += 1
|
Global.undos += 1
|
||||||
Global.undo_redo.create_action("Remove Layer")
|
Global.undo_redo.create_action("Remove Layer")
|
||||||
|
if Global.current_layer > 0:
|
||||||
Global.undo_redo.add_do_property(Global, "current_layer", Global.current_layer - 1)
|
Global.undo_redo.add_do_property(Global, "current_layer", Global.current_layer - 1)
|
||||||
|
else:
|
||||||
|
Global.undo_redo.add_do_property(Global, "current_layer", Global.current_layer)
|
||||||
|
|
||||||
for c in Global.canvases:
|
for c in Global.canvases:
|
||||||
var new_canvas_layers : Array = c.layers.duplicate()
|
var new_canvas_layers : Array = c.layers.duplicate()
|
||||||
|
|
Loading…
Add table
Reference in a new issue