Fix #2460 and #2355 - line widgets don't update scroll height

Using the fix you wrote for #2282, I fixed #2355 and #2460.

I also wrote some tests for the line widget methods so this doesn't regress.