-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Autowrap breaks button size. #99878
Comments
I'm also having issues with autowrap and button sizes, but it's a bit different. If I dynamically create a button (with autowrap on) and put it inside a VBoxContainer, if the text is more than one line, the text will flow outside of the button, but weirdly, if you hide and show the button, it fixes the size. But it has to be seen in game first before it will fix itself, so I've spent hours just trying to get it work correctly. Also on 4.3. It only seems to happen when the font is bigger than the default one, though. But, I tested it in the latest 4.4 dev build, and it works fine! So at least my problem has been, fixed, maybe check to see if your issue has been fixed. |
I have no idea, after opening the project in 4.4 I couldn't reproduce it with the MRP and after that I reopened it in 4.3 (after importing the project into 4.4) and could not reproduce it either. |
I can confirm that I ran into this problem in 4.3 but once updating to 4.4 I did not have this problem |
From what I can tell @timothyqiu fixed this problem here 0f98b32 which has already been pushed to the main branch |
Fixed by #97389. |
Tested versions
4.3
System information
Win 11, i513600kf, RTX 4070.
Issue description
When autowrap is set it breaks the size of buttons with Godot's automatic sizing in games as well as in plugins.
Video: https://youtu.be/f-Zi81_Ocsw
In the video everything had its custom size set for X, after the video I also set it to Y (with a more than enough of a value) - for the plugin part of the video the buttons as well as other elements have both X and Y minimum sizes set properly with enough buffers - but it still breaks.
(It breaks with any autowrap option other then Off)
Steps to reproduce
Add couple buttons, assign text to them which spans couple words so you can test the wrapping, to a HBoxContainer, set custom min sizes to buttons as well as the container, set the anchors and offset values to Left Wide then grab the HBoxContainer right side handle and move around to shrink/enlarge the box until you observe the issues as in the video, for comparison you can move slowly to see how it works properly or when broken you can change the custom min size to some value just barely above/below your so Godot automatically resizes everything correctly.
Second option, add an EditorPlugin as described above to the viewport, resize the viewport to make sure it doesn't span the entire viewport and then just got Project Settings - Plugins and enable and disable the plugin just like I did in the video, this way you can see how the size gets messed up, if you move the viewport handle then even by just a pixel it properly resizes again.
Minimal reproduction project (MRP)
AutoWrapMrp.zip
The text was updated successfully, but these errors were encountered: