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

Autowraping Label within AspectRatioContainer causes crash #99520

Open
onesuchkeeper opened this issue Nov 22, 2024 · 2 comments
Open

Autowraping Label within AspectRatioContainer causes crash #99520

onesuchkeeper opened this issue Nov 22, 2024 · 2 comments

Comments

@onesuchkeeper
Copy link

onesuchkeeper commented Nov 22, 2024

Tested versions

Godot_v4.3-stable_mono_win64

System information

Godot v4.3.stable.mono - Windows 10.0.19045 - GLES3 (Compatibility) - NVIDIA GeForce RTX 3070 (NVIDIA; 32.0.15.6081) - Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz (16 Threads)

Issue description

A Label with Autowrap inside an AspectRatioContainer too small to fit it will crash not only a project but the Godot editor itself.

If you're experiencing this issue and it hasn't ben resolved yet, setting the Text Overrun Behavior of the label to anything other than "Trim Nothing" will prevent the crash. This is not a full workaround though, as it forces the label to shrink to it's minimum size when in a container with other controls, which may not be your desired behavior.

Steps to reproduce

  1. Create a new project
  2. Create a new scene with root node of type AspectRatioContainer and set its anchor preset to full rect
  3. Nest a Label node inside the AspectRatioContainer node
  4. Set the Label's Custom Minimum Size to (32,32)
  5. Set the Label's Autowrap Mode to Arbitrary (also occurs on Word and Word (Smart))
  6. Set the Label's 'Text' property to a string long enough such that it overflows the bounds of the container

-Expected Result-
The label expands the bounds of the container to accomidate, similarly to how a label with Autowrap off will expand the container.

-Result-
The Godot editor stops responding and crashes

Minimal reproduction project (MRP)

aspectratiocontainerissue.zip

@onesuchkeeper
Copy link
Author

onesuchkeeper commented Nov 22, 2024

Setting the Label's Horizontal Alignment or Vertical Alignment to Fill produces the expected behavior, where the aspect ratio is broken and the container is expanded to fit the label

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