When the search bar is visible and user scrolls terminal contents,
(part of) one line is rendered twice. The effect is visible on
semi-transparent pixels (i.e. antialiasing) with some font sizes.
With this patch, the characters which should be painted are calculated
once. It was done for every rect in a paint region separately before.
When two rectangles included different parts of a line, it was drawn
twice. Only part of the line had visual effect visible, as each
rectangle was cleared before rendering.