Bug 551320 - Fix missing line numbers on GTK with static scrollbars

On GTK with static scrollbars the ruler canvas is higher than the
visual text area (text viewer minus horizontal scrollbar height).
JFaceTextUtil.getVisibleModelLines() sometimes returns a bottom model
line that actually ends above the lower edge of the ruler canvas. When
that occurred, subsequent scrolling down in the text could lead to
missing line numbers.

Account for that by considering only pixels up to the bottom line's
bottom, and clearing the rest of the canvas.

(Note: on Mac with static scroll bars, the ruler canvas ends at the
top of the horizontal scrollbar and thus always has the same height
as the visible text area, and hence this problem doesn't occur.)

Verified manually on OS X and on Linux/GTK with both static and
dynamic scrollbars and found no rendering problems.

Change-Id: Iaf7bd4627594590e9e421b48c6de99578927625a
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
1 file changed