Base the visible lines on the height instead of the clientHeight

Because overlay scrollbars are invisible unless scrolling and even
regular scrollbars can be transparent.