godotengine / godotengine/godot

Y-size of GraphNodes with RichTextLabel and "Fit Content: True" gets huge when reloading scene

Open
#90,844 0 comments 0 reactions 0 assignees View on GitHub
bug topic:gui
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Tested on v4.2.1.stable.mono.official [b09f793f5]
NOTE: No scripting is necessary, so mono/non-mono should not matter (in theory).

### System information

Godot v4.2.1.stable.mono - EndeavourOS #1 SMP PREEMPT_DYNAMIC Thu, 11 Apr 2024 01:47:33 +0000 - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 7800 XT (RADV NAVI32) () - AMD Ryzen 5 3600 6-Core Processor (12 Threads)

### Issue description

Title, basically. When a `GraphNode` contains a `RichTextLabel` with "Fit Content" set to true, reloading the scene will cause the graph node to expand along the Y axis to a ridiculous degree. The issue seems related to the size of the `GraphEdit`, a larger graph will result in larger Y-size.

### Steps to reproduce

1. Add a `GraphEdit` with one or more `GraphNode`s as children
2. Add a `RichTextLabel` with some text as a child of one of the `GraphNode`s
3. Check the "Fit Content" option
4. Reload the scene
5. The nodes containing the rich text are now huge.

### Minimal reproduction project (MRP)

[graph-edit-rich-text-bug-demo.zip](https://github.com/godotengine/godot/files/15023398/graph-edit-rich-text-bug-demo.zip)

No scripts are used, should be independent of C#/GDscript

Contributor guide

Open the contributing guide

Research direction

Open the linked graph-edit-rich-text-bug-demo.zip and reproduce the issue with GraphEdit, GraphNode, and RichTextLabel using Fit Content. Trace the layout and sizing behavior during scene reload, especially how GraphEdit size affects the node's Y dimension. Done means reloading the scene no longer makes nodes containing fitted RichTextLabels grow to an excessive height.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.