@TwistedTwigleg said:
From what I can gather from the source code linked above, it looks like the page
property is the size of the content it is scrolling.
After SIGNIFICANT experimentation, I've manage to determine that this is WRONG.
I finally just printed every Range property every frame to see what was happening, and after pouring over the ream of output text, no. page
is most certainly not the size of the content. It is the size of the window, which in retrospect is obvious if it is getting its value from the size of the ScrollContainer rather than from the size of the ScrollContainer's child node. The variable that matches the size, in pixels, of the content, is max_value
, not page
.
Now's where things get weird.
Manually setting get_h_scrollbar().max_value
and get_v_scrollbar().max_value
to the new size of the TextureRect actually causes the scrollbars to visually update, with the movable handle shrinking or growing to match the TextureRect's change!
HOWEVER, the moment I actually scroll/resize the window/etc. the scrollbars snap back to their previous states.
This implied that the ScrollContainer itself was keeping the starting max values and overriding my change as soon as it updated. To text this, I added ScrollContainer.update()
on the next line of code. The result was that changing the max values no longer had a visible effect, confirming that ScrollContainer is remembering the original max values and resetting the scrollbar's properties to those original values when it updates.
update_scrollbars
is the problem here, not the solution
In conclusion, the scrollbars's properties are being overridden by a property of the ScrollContainer upon the ScrollContainer's update, a property which holds the size that ScrollContainer's child node was on ready. WHAT IS THIS PROPERTY? It is not listed in the ScrollContainer class, nor the Container class, nor the Control class.
@Megalomaniak said:
maybe you could try firing the scrollcontainers _ready signal to see if that updates it?
How do I do that? I assumed just calling ScrollContainer._ready()
would break something.