0 votes

[Godot 3.1.1-Windows10/64]

While adding a child like LineEdit ,TextEdit,Button etc to the Hboxcontainer ,and changing it's "x" width ,the child's width keeps defaulting to it's original "x" value of "58".

Also ,when a new child is added by duplicating the existing child (whose width was manually changed {other than 58}),the new child defaults to a width of "58" and is placed at a "x" position of 62 (58width +4margin ) from the left edge of the Hboxcontainer .This behavior is seen for additional children as well.

Following Default Values were used for the above test
(testing with other values also generated similar , above mentioned behavior)
Hboxcontainer---> Alignment -Begin,GrowDirection -End , SizeFlag - Fill
ChildNode---> Alignment -Left ,GrowDirection -End , SizeFlag - Fill

Anchor,Margin etc have not been changed and have been kept at their default values.
Note -RightMargin also defaults to 58 .

Is this a bug or am I missing something?

in Engine by (51 points)

1 Answer

0 votes

The function of a Container is to override position and size of any child control (except the minimum size). This is at the moment only enforced when trying to edit the child control visually via the 2D view and not in the inspector.

by (1,001 points)

Yeah , in an ideal case -the function of a Container is to override the position and size of any child control (except the minimum size).
But when the child doesn't scale automatically to fit the Container and keeps defaulting to an arbitrary constant size ("58" Xwidth,[in this case]) ,then the above argument no longer holds.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.