Currently AutoCanvasSize fails to fit elements when the padding on a UIListLayout/UIGridLayout is using Scale values over Offset values. This results in the scrolling frame not fitting elements correctly and leaving a large amount of whitespace at the bottom.
Expected behavior
I expect AutoCanvasSize to fit everything in frame perfectly.
@CharlieGordonnn Mind looking into this? This issue is severely impacting my workflow and it’s what I was trying to get at here (except I didn’t actually know the cause):
When you join into it via playtest, you’ll notice the UI on the left (the one using just AutomaticCanvasSize) scales incorrectly, cutting off multiple elements in the scrolling frame. (Yes, this is different to OPs behavior, but this issue can cause either lots of empty space OR not enough space in ScrollingFrames). Take a look at the screenshot below:
Note that I disabled the ClipDescendants property on both the ScrollingFrames to demonstrate the issue at hand. Assistance with this would be highly appreciated.
Worth noting that the solution here does not result in the same behaviour as using AutoCanvasSize. Since the Scale value in Grid and List layouts is based on CanvasSize and not Size (why?), having more elements in the list causes large amounts of padding. I believe List and Grid layouts should respect ScrollingFrame.Size over ScrollingFrame.CanvasSize (or at least have a property like UIAspectRatioConstraints do which let you decide which one it should respect).
Hi @Tom_atoes@bvetterdays , thanks for reporting the issue and yes this one is a known issue that using scale size + AutomaticSize/AutomaticCanvasSize has conflicting behaviors, because the parent and children sizes depend on each other, which results in the issue of having more elements in the list causes large canvas size so that scale sized elements will be larger.
@bvetterdays In your repro file, when you set the list children’s scale size to be 0.1 on Y axis, may I know which size you were expecting the children size 0.1 to be based on? Is it the scrolling window size, or the canvas size, or the size of the parent of scrolling frame?
Is it possible to have Scale respect Parent.Size over Parent.CanvasSize? I can’t think of any reason why you would want padding to scale based on the number of elements.
Also I noticed in the repro file, when you set the scrolling frame to be an offset size, the canvas size seems to be calculated correctly. I can take a further look.
Hey @bvetterdays , I have looked at the problem and the padding was not correctly calculated when the scrolling frame is using a scale size (in the repro file you shared) which needs a fix.
However, scaling based on Parent.Size rather than Parent.CanvasSize may not be an easy fix because this may break existing experiences as it was designed that way at the beginning. We are aware of this feedback and also did some discussions around this before, while after all, this current behavior may stay for a while until we have new objects/features designed in the future.