Refactoring the draw() implementation to make it more readable: - taking out the line trimming logic. - taking out the drawing of the scroll up/down markers.
The line scanner identifies and counts lines in the input text and performs wrapping if required.