-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Popup with container and autowrap Label doesn't sort properly #83546
Comments
Can confirm this bug in 4.2-beta1_mono, just happened to reproduce it while testing out GraphNode, a Label will break the height calculation of the GraphNode as soon as Autowrap (any mode) is activated. Important note: Edit : here's the project I made to test this label_wrap_bug.zip |
I can confirm the bug with the two MRPs in this issue. It seems to have been introduced in 4.2-dev3 (4.2-dev2 behaves like 4.1.2-stable). If someone wants to bisect further between dev2 and dev3, that would be very useful. |
Seems similar to #80218. |
See my exhaustive comment here #80218 (comment). This is not something we can currently fix at its core. You should ensure your labels have at least some reasonable minimum size, and everything should work correctly. For editor widgets we should add minimum sizes where they are required as well. |
In case of Size2 Label::get_minimum_size() const {
+ if (autowrap_mode != TextServer::AUTOWRAP_OFF && get_size() == Size2()) {
+ return Size2();
+ }
+ |
The behavior of the label is technically correct, so this isn't really a good solution. In any case, I wouldn't touch it at all right now. Because of the underlying issues every time we touch these nodes, we risk multiple regressions. The problem is documented, it's fine for the release in this state. This is better than introducing potential and unknown issues without any time to test everything. |
#84662 adds a node configuration warning for Labels using autowrap in containers, to make users aware that this is not a stable setting unless a custom minimum size is specified. So this alleviates the problem for 4.2, until we can rework the sizing logic to follow a better approach. |
This also works around the MRP: label.set_anchors_and_offsets_preset(Control.PRESET_TOP_WIDE) Slightly cleaner than |
Labels with autowrap inside a Container must have a minimum size. See godotengine/godot#83546
- Instead of `DisplayServer.window_set_min_size` the project now uses `get_window().min_size = ...` everywhere (as the docs recommend). - Overlay components are now checked for two meta property `x_padding` and `y_padding` which can be used to increase the minimum size of the window in cases where the component is bigger than the previous min. - Each component `item_rect_changed` signal is now connected to the new `_update_min_size` function when opened, which ensures that the window will always big enough to contain the entire component. - A label in the settings panel uses auto-wrapping, which currently leads to issues when the label has no custom_minimum_size, see: godotengine/godot#83546 I opted for an alternative fix (as proposed by nathanfranke in the issue linked above) which involves setting the anchors and offset of the label to the TOP_WIDE preset.
Godot version
v4.2.beta1.official [b137180]
System information
Arch on 6.5.7-arch1-1
Issue description
I'm not sure exactly what the issue is, but easy to reproduce.
Even in the project manager, this window is much bigger in 4.2.beta1 than 4.1.2.stable.
In both cases the increased height is the Label wrapping with a width of zero.
Closing and re-opening the popup works around the issue.
4.1.2:
4.2.beta1:
Steps to reproduce
Launch MRP in 4.2.beta1+ or click an outdated project in the project manager.
Minimal reproduction project
test7-sizing.zip
The text was updated successfully, but these errors were encountered: