The current implementation is lying, it returns negative values if the
inner rect has a zero width or height but also a scrollbar - which
doesn't mean there's a "negative size" available though; it's still "no
size available", i.e. 0.
This fixes flipping between left/top and right/bottom when the rectangle
to make visible doesn't fit into the visible portion each time the
function is called.
In order to calculate a thumb size that is a representation
of the visible portion (page) of the content, that information
needs to be taken into account.
This function relies on visible_content_rect() which could previously
return rectangles with negative size. This was causing TableViews to
scroll down a little bit when assigning a model to them.
Also tweak the logic so we scroll a 0x0 rect into view, giving a
slightly nicer final position.
This was most notable in the widgets TextBox and TextEditor (and
therefore also ComboBox and ColorInput), because there the cursor
regularly landed just one pixel outside the visible region when
going to the right.