Inexplicable behavior with ScrollingFrame, UIGridLayout and UIAspectRatioConstraint

Not 100% sure this is a bug and just me not understanding how things are supposed to work.
I have a ScrollingFrame with a UIGridLayout in it and a UIAspectRatioConstraint in that. It works for constraining grid sizes but there’s one inconsistency which seems to happen:
After I populate the frame in script with clones of a small frame template I then wait a frame and resize the ScrollingFrame canvas to the absolute content size of the grid so the user can scroll through all the grid cells.
And then the grid cells resize - and no longer fit the new canvas size anymore.

I’ve rolled back the code in my place that exhibits the behavior but if you can’t reproduce go ahead and get in contact and I’ll provide a sample.

1 Like

I encountered this problem before as well. I managed to fix it by using the Offset values of UDim2 instead of Scale.

1 Like

Kind of defeats the purpose of the new UI stuff which is supposed to let us scale things to a % of the screen, though, yeah?

A bit, but I’m just glad we have them.

1 Like

FWIW we are working on “Fit To Contents” sort of property or component that will do this resizing of the canvas for you. Don’t have an ETA yet, but we are working on it.

2 Likes

Great! That’s gonna help me a ton with my GUIs. :grin: