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
Some containers don't respect size flags #47559
Comments
I don’t know why exactly CenterContainer doesn’t allow expand, but if it did, it would be no different from MarginContainer. If you use MarginContainer with shrink center for vertical flags, you will get the result you were looking for. So I guess, yes, it is the design of CenterContainer to absolutely always center its content. |
If you can't restrict child controls with expand flags with the size constraints of their parent containers most complex ui layouts would completely explode if screen sizes and layouts are changed. I think CenterContainer is the only Container type that ignores the expand flags of child controls completely and only works if you set a minimum size for the children. At least I never had this behaviour with other control container types. Others container controls always allow child controls to use all available space within the container control constraints. On the other hand I can't think of a valid point for the existence of the CenterContainer node if it would always stretch to children with expand flags set. It would just do the same as setting anchor points. |
I'm not restricting child controls with expand flags. I want the controls to resize based on its children/content not its parent
Minimum size should be a minimum hard limitation of that control.
Wtf point is a control if makes the controls in them a size of 0,0?
I don't see what the point in having two controls do the same thing then. |
Control "expand" flag is not expand in the sense "use just as much space as you need" but more "flood fill and use all space that you can grab from other controls without an expand flag inside your parent container" so the only workable way to restrict child controls with expand flags from taking up the entire screen is their parent container size. Minimum size already works as a hard minimum limit for control sizes.
To place the child control at the very center but it also requires to give the control a minimum size or else it turns to 0,0. Not optimal but that is how it currently works. |
yes i know but thats what I am saying its not doing that.
|
Godot version:
3.2.3
OS/device including version:
Kubuntu 20.10 64bit
Issue description:
I have found that alot of containers do not respect controls size flags.
Most people just pass it off as design but I disagree.
When I think of expand I think a flag that makes the control take up as much space as it needs...
When I think of fill I think a flag that makes the control take up as much space as it can...
When I think of min size I think of the minimum size of that control without size flags.(size flags should override sizes greater)
As you can see my value label does not fill the space needed even though...
HBoxContainer has both expand and fill for both x and y,
Name has expand for x and fill for x and y,
Value has both expand and fill for both x and y.
messing with these doesn't affect the center container at all because it doesn't take in account it's children's calculated size.
Steps to reproduce:
Minimal reproduction project:
Asteroids.zip
The text was updated successfully, but these errors were encountered: