According to the wiki, CanvasSize is:
Determines the size of the area that is scrollable. The UDim2 is calculated using the parent gui’s size, similar to the regular Size property on gui objects.
This leads me to think that when the frame is scrolled to its bottom, the CanvasPosition.Y should equal:
(Frame.AbsoluteSize.Y*Frame.CanvasSize.Y.Scale)+Frame.CanvasSize.Y.Offset
Is that not right?
My tests have been finding very different results.
Test A:
ScrollingFrame with an AbsoluteSize of (200,200)
, and a CanvasSize of (0,0,2,0)
.
Expected bottom CanvasPosition: 400
Actual bottom CanvasPosition: 1172
Test B:
ScrollingFrame with an AbsoluteSize of (300,300)
, and a CanvasSize of (0,0,2,0)
.
Expected bottom CanvasPosition: 600
Actual bottom CanvasPosition: 1072
Test C:
ScrollingFrame with an AbsoluteSize of (500,500)
, and a CanvasSize of (0,0,2,0)
.
Expected bottom CanvasPosition: 1000
Actual bottom CanvasPosition: 872
What? Where is that number coming from? Why is it shrinking as AbsoluteSize increases? What calculation have I wildly missed?
They all end with 72, so there’s clearly a simple, static equation here that I’m overlooking, and I’m sure I’ll facepalm once I find out the answer.
Edit:
I’d love a feature of just Frame.ScrollWindowSize that acts as an AbsoluteSize of the scrollable window. Please.