AutomaticCanvasSize is borderline useless in its current state

I’ve recently been working on an in-game store for a project of mine that relied heavily on the AutomaticCanvasSize property of ScrollingFrames. Apparently, this property is completely inept at accomplishing its only function when UIScale (or scaling in general) is used anywhere in the ancestor hierarchy in your UI. This issue becomes EXTREMELY pronounced when used in conjunction with UIScale and UIGridLayout.

Examples showing its unpredictable erroneous behavior:
Opening Store in Studio
https://streamable.com/x4y6ub

Opening Store in Player
https://streamable.com/x4ji24

As you can see, the property is entirely incapable of actually sizing the scrolling canvas according to its contents; especially when the top-level ancestor is using UIScale for more consistent multi-platform support. I’m willing to bet the issue is due to the internal code not relying on the AbsoluteSize of the contents.

Because of this issue I am now forced to completely scrap the use of this property and write my own solution. This is causing me to spend pre-allocated work hours writing code that shouldn’t need to be written.

Really hoping for a proper fix/rework of this property in the near future. It does nothing but negate productivity for UI designers that work to properly scale their designs for multiple platforms.

Thank you in advance.

15 Likes

AutomaticCanvasSize was probably the biggest let down I’ve ever experienced when it comes to testing new features like this, absolutely didn’t deserve to be pushed in a live build of studio as it doesn’t work with UIGridLayouts like @FriendlyBiscuit mentioned…

Improvements coming soon yes? :+1:

3 Likes

Hi @FriendlyBiscuit - thank you for taking time to share your feedback and frustrations with AutomaticCanvasSize. I went ahead and created a high-priority ticket to address this.

To provide some transparency, there are a few critical issues ahead of this (and several other reported bugs) in the pipeline, however, resolving issues such as this is our top priority right now. We’re aware that these bugs are blocking developers such as yourself from fully utilizing AutomaticSize and AutomaticCanvasSize.

I truly appreciate your patience and personally understand the frustration of losing hours of work due to a broken feature/bug. Again, thanks so much for voicing your feedback and frustration! :pray:

15 Likes

Hi @starchip12 - thank you for sharing your feedback. Yes, improvements are on the way :sweat_smile:

6 Likes

Thank you for the response! Glad to hear this is being looked at!

1 Like

Thank you so much! Truly excited for an updated version! :smile:

3 Likes

Still happens to this day when using UIListLayouts.

Can second this. It’s super unstable.

Only workaround I’ve found was to set the canvassize to the UIListLayout’s AbsoluteContentSize on renderstepped.

1 Like

That’s smart. What I did was each time a object was inserted I grabbed it’s AbsoluteSize.Y and added it to the CanvasSize’s Y offset.

-- I used the Promise module, so I had to do this each time I made a frame instead of using .ChildAdded

function createItem()
    local item = itemFrame:Clone()
    scrollingFrame.CanvasSize.Y.Offset = item.AbsoluteSize.Y + 5 -- 5 pixel padding
end
1 Like

That would work too. Only issue is that it would cause inconsistencies when the window is resized.

1 Like

That’s true, I honestly forgot about the viewport size changing! Thanks for that reminder. How is performance for constantly updating it with the RenderStepped signal?

1 Like

I haven’t tried it on a mass scale (only about 4 scrollingframes) but overall it’s quite smooth. You could probably do some checks before resizing it (like checking if the old absolutecontentsize is different than the new size) but overall I don’t find it to be too bad. IIRC the script activity was like 0.004%. But if you’re doing it on a large scale, maybe try doing it on every wait(), or do :GetPropertyChangedSignal on the size.

1 Like

I did manage to find a workaround for my workflow in which I monitored the scale factor of the UI based on the viewport size, and manually modified CanvasSize by multiplying AbsoluteContentSize by 1 / scale_factor. It pretty much guarantees that the biggest issue (not sizing to correctly for scaled content) is directly tied to whether or not the top-level ancestor is scaled or not.

I cannot provide a snippet at this time as it uses some custom libraries that wouldn’t work in other environments. I’ll see if I can throw together a more modular solution and edit it into the OP for others who experience this issue.

4 Likes

This is one of the most annoying bugs I have come across. Every time I am dealing with any automatic resizing of the UI it never works. I’m currently trying to figure out how to use AutomaticSize with textbox. I’ve tried using a scrolling frame with AutomaticCanvasSize but the canvas size doesn’t change with the textbox size. The only way to get the scrolling frame to work is to use AutomaticSize on the actual size of the scrolling frame, not the canvas. I’ll probably have to go in manually and do it, which isn’t a huge deal. But I would think these features would be released in working format, especially since it’s supposed to allow a user to take less time designing UI. Instead, I end up taking longer than just hard coding the auto scaling myself.

Over one year has passed and this erroneous behavior still has not been fixed.

I’m going to assume that support for the property has been abandoned at this point.

5 Likes

Hi @FriendlyBiscuit , could you help confirm if the issue is still happening? If so, could you kindly provide some repro files and videos since the ones in the original post are not available. Thanks!