Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PanelContainer does not auto-resize to smaller size when inner RichTextLabel text gets shorter #100626

Open
Sch1nken opened this issue Dec 20, 2024 · 0 comments

Comments

@Sch1nken
Copy link
Contributor

Tested versions

Tested in Godot 4.3.stable (Linux). Also tested in 4.4 Dev 7.

System information

Godot v4.4.dev7 - Manjaro Linux #1 SMP PREEMPT_DYNAMIC Mon, 09 Dec 2024 11:58:37 +0000 on X11 - X11 display driver, Multi-window, 2 monitors - Vulkan (Forward+) - integrated AMD Radeon Graphics (RADV RENOIR) - AMD Ryzen 7 4800H with Radeon Graphics (16 threads)

Issue description

A PanelContainer fits its size to a containting RichTextLabel (Fit Content ON, AutoWrap Smart) but does NOT fit its size once the richtextlabel text gets smaller.

Both the PanelContainer and the RichTextLabel have a custom minimum size set (though behaviour is the same without a custom minimum size).

Looking at the remote view, the RichTextLabel has a ScrollBar child even if "scroll active" is set to false (RichtTextLabel) and the scrollbar takes up the whole height of the PanelContainer (not sure if this is relevant).

2024-12-20.02-28-46.mp4

Having something like a VBoxContainer between the PanelContainer and the RichTextLabel will properly resize the VBoxContainer but will still not resize the PanelContainer. (Video Example has the following setup: PanelContainer (Grey) -> VBoxContainer -> MarginContainer -> PanelContainer (Red) -> RichTextLabel). Issue persists even without the MarginContainer...

2024-12-20.02-36-10.mp4

I have a proper project with a more complex issue (probably related to this one) where upon instantiating a scene with RichTextLabel has wrong dimensions for the first frame after add_child().

Steps to reproduce

Create a PanelContainer, add child RichTextLabel, set "fit content" to ON.

In-game set RichTextLabel.text to something larger, then set it back to something smaller. The PanelContainer does not resize back.

Minimal reproduction project (MRP)

Not quite MRP (there is some variants on the issue I did to narrow down the issue): PanelContainerResize.zip

Files are now for 4.4 Dev 7 (auto converted)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants