AutomaticSize displaying inaccurate results

Reproduction Steps

When a ScrollingFrame, with AutomaticSize and AutomaticCanvasSize set to true, and a UIListLayout, is populated with GuiObjects that have a UIPadding instance inside of them, both AutomaticSize and AutomaticCanvasSize display inaccurate results.

All four of the TextLabels inside of the ScrollingFrame have a Size of UDim2.new(1, 0, 0, 50) and a UIPadding with 5 pixels on each side (10 pixels total on the Y axis). The TextLabel's AbsoluteSize is Vector2.new(X, 50) (accurately not accounting for the UIPadding), which means that the ScrollingFrame's AbsoluteCanvasSize should be Vector2.new(X, 200).

The ScrollingFrame's actual AbsoluteCanvasSize is Vector2.new(X, 240). The 40 additional pixels on the Y axis come from the 10 pixels padding each of the four TextLabels.

Without the UIListLayout, the AbsoluteCanvasSize is Vector2.new(X, 210), which means that AutomaticCanvasSize is only accounting for UIPadding

This should not be the case because Padding does not add size to GuiObjects.

I have added a place file that has the steps to reproduce this issue.

In the place file, there are already UIPadding instances inside of all of the TextLabels. If you delete all of the UIPadding instances, AutomaticSize and AutomaticCanvasSize will behave as expected.

AutomaticSizeIssue.rbxl (43.6 KB)

Expected Behavior

I expect for AutomaticSize and AutomaticCanvasSize to not use UIPadding of children GuiObjects, as UIPadding does not increase the Size of them.

Actual Behavior

AutomaticSize and AutomaticCanvasSize produce inaccurate results when calculating the AbsoluteSize and AbsoluteCanvasSize when calculating for a GuiObject that has children with UIPadding instances inside of them.

Issue Area: Engine
Issue Type: Display
Impact: High
Frequency: Constantly
Date First Experienced: 2022-08-02 00:08:00 (-05:00)
Date Last Experienced: 2022-08-02 00:08:00 (-05:00)

5 Likes

I believe the Roblox UI engine developers do realize this is an issue, but fear that it will break games that rely on this functionality since AutomaticSize/AutomaticCanvasSize has been around for quite a while.

Thanks for the report ! We’ll investigate and update you on the matter.

2 Likes

I have some more information regarding my issue. I believe the inaccuracy is caused by UIScale.

yes please, we also need some fixes on automaticsize not working with scale but rather offset!

1 Like