Strange space at the left side of the margin container.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By heleg

When I place ColorRect (or some another kind of control node) inside the MarginContainer, I have this strange margin on the left side: child node’s margin always become 8.

node tree
margin 8

Maybe, I don’t understand usage of this type of container. Actually, I don’t see the difference between functionality of MarginContainer and simple Container.
Please, explain me this kind of behavior.

Thank you.

:bust_in_silhouette: Reply From: tomandrieu

Go in your margin container custon constant field and check “margin left”
I don’t know why there is this weird space but this should do the trick.

Thank you for advice.

Margin disappeared when I set it to zero. Is it a bug?


heleg | 2018-07-18 20:59

:bust_in_silhouette: Reply From: hinasis

Margin container has custom parameters, for top, left, right, and bottom margins, that take an int value that represents the distance in pixels the children are from the container’s borders.
Don’t confuse it with the common margins that every control has, they are at the end of the inspector.

Thank you very much for explanation.

This vague description just confuses me more.

Simple margin container. Adds a left margin to anything contained.

Should we contribute a better explanation? What do you think?

heleg | 2018-07-18 21:04