Calculate position correctly when scrollbars are present
The only caveat now is related to wrapping that leaves whitespace at the end of the previous line.