You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Early in the video you can observe no issues when autowrap is disabled.
In the video you can see that if you move slowly the buttons get properly resized but if you move quickly you can break it.
In the second half you can watch the same issue with an Editor plugin I added which is automatically resized by Godot and not me which means it's not just an issue of moving mouse too quickly.
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.
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.
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: