AnchorPoint & AutomaticSize have broken/poor behavior

If you parent a UI object into a container UI, where the container has AutomaticSize and the child has an AnchorPoint that is not 0,0, it leads to incorrect positioning of the container:

Repro place:
automaticsize + anchorpoint bug.rbxl (60.1 KB)

Expected behavior

I would expect the text to remain centered, just like if it were to not have AutomaticSize enabled.

That looks normal to me. Setting the anchor point to 0.5, 0 doesn’t mean it’s in the center. Your position has to match, too. The way it is right now is 100% expected and correct.

sorry, I made the repro too minimal. setting the bottom text’s position to 0.5, 0 (scale) causes this, and requires setting its position to 1, 0 (scale) to have it properly centered within the frame.
RobloxStudioBeta_1b7Xeo45wa

I’m not sure how automatic size works internally, but we can make some predictions.

Technically what you’re seeing is not undefined behavior. I believe how automatic size works is it checks the future size and position of the child relative to the present state of the parent, then applies the changes such that the new changes fit the child. Here’s a visual example:

Although, as a rule of thumb, I would stray away from using non-zero anchor points on the automatically sized axis. This is because non-zero anchors are less predictable. 90% of the time, you don’t need special anchor points.

I use automatic sizing extensively, and I have always found a workaround for these special cases. If you want I can try to see if there’s a workaround for your situation if you explain what your goal is.