godotengine / godotengine/godot
Visible Ratio on RichTextLabel doesn't update size dynamically in Godot 4.5
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Godot 4.5
### System information
Windows 10
### Issue description
In Godot 4.5, changing visible_ratio in a RichTextLabel with fit_content=true does not dynamically adjust the node's size (neither minimum_size nor the rendered size), unlike Godot 4.4.1, where the box resized in real-time according to the visible text.
This is noticeable when a texture appears expanded to the final size of the text, even before the text has been fully displayed.
Here you have a couple of version comparisons.
Godot 4.4.1
https://github.com/user-attachments/assets/87a924f0-8585-4684-8d0d-554c8850960c
Godot 4.5
https://github.com/user-attachments/assets/68ab328a-077f-456d-ba1e-43d8ef008fe1
### Steps to reproduce
1. Create a RichTextLabel with fit_content enabled.
2. Assign multi-line text.
3. Use a tween or script to change visible_ratio from 0.0 to 1.0.
4. Observe that the size does not adjust to the visible text (it remains the total content size).
### Minimal reproduction project (MRP)
I’m sharing a test project that includes the features where this bug is reproduced. As you will notice, when manually changing the visible_ratio, the text box consistently retains the final size of the RichTextLabel, as it does not adjust dynamically.
[test-ui.zip](https://github.com/user-attachments/files/22433650/test-ui.zip)
Contributor guide
Research direction
Start by running the attached test-ui.zip project in Godot 4.5 and compare its RichTextLabel behavior with Godot 4.4.1. Reproduce the visible_ratio transition with fit_content enabled, then trace the RichTextLabel sizing behavior. Done means the node size follows the currently visible text during the transition, matching the earlier version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, godot
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100