fix adding one more empty task than expected
authorEduardo <[email protected]>
Mon, 2 Oct 2023 17:46:16 +0000 (19:46 +0200)
committerEduardo <[email protected]>
Mon, 2 Oct 2023 17:46:16 +0000 (19:46 +0200)
scenes/todo_list/ToDoList.gd

index e2c75dcac8c14b3e18eceaf18a8bad8126964158..4572802b4615fd3c832b64b1c7b90b9c82b77f91 100644 (file)
@@ -32,7 +32,7 @@ func load_tasks():
        _add_empty_entry_at_bottom(3)
 
 func _add_empty_entry_at_bottom(how_many: int):
-               for i in range(how_many + 1):
+               for i in range(how_many):
                        var el = load("res://custom_elements/todo_list_elements/todo_element.tscn").instantiate()
                        reorderable_list.call_deferred("add_child", el)
                        el.call_deferred("set_priority", 0)