RichTextLabel (RTL): add_text(), append_text(), add_image() (and probably others) do not work on orphan RTL #100772
Description
Tested versions
Reproducible in: v4.4.dev7.official [46c8f8c], v4.3.stable.official [77dcf97]
System information
Godot v4.4.dev7 - Windows 11 (build 22631) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce MX450 (NVIDIA; 32.0.15.5613) - 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 threads)
Issue description
add_text(), append_text(), add_image() and probably other similar functions do not work on orphan RichTextLabel. Setting the text property directly works.
In the Minimal reproduction project, I only used append_text(), but in my current project in v4.3.stable.official add_image() doesn't work either.
I think it's a bug because I didn't find anything that explains why it behaves like that.
It's pretty simple to bypass putting add_child() before add_(). Deferring the add_ functions works too. However, I think it's not the expected behavior.
Steps to reproduce
- Create a RichTextLabel by code (instantiating a scene or creating a new RTL with enough size)
- Add some text using add_text() or append_text()
- Add the RTL to the tree with add_child()
Can be done on a brand new project. I added a Minimal reproduction project anyway.
Activity