Fix double render when scrolling with visible search bar
Summary:
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.
Test Plan:
- set font to DejaVu Sans Mono 7pt (tested with 96dpi). Other fonts/sizes can work too, just make sure the bottom edge of the search box is not exactly between lines
- run printf '%3d▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒\n' $(seq 500)
- open search box
- scroll up/down using mouse wheel
Actual result: One line is brighter (painted twice)
Expected result: All boxes should look the same
- run in a bash/zsh:
reset printf '.%.0s' $(seq $(( LINES * COLUMNS ))) printf '\033[?7l' printf '\033[%d;%dH%c' 1 1 A 1 $COLUMNS B $LINES 1 C $LINES $COLUMNS D read reset
- from "File" menu select "Print Screen..."
- print to PDF file (or real printer if you want)
Expected result: printed document must contain whole terminal screen
(A, B, C, D in top left, top right, bottom left, bottom right corner,
respectively, and dots filling the screen)
Reviewers: Konsole, hindenburg
Reviewed By: Konsole, hindenburg
Subscribers: hindenburg, konsole-devel
Tags: Konsole
Differential Revision: https://phabricator.kde.org/D16033