Skip to content

Fix black pixel at (0,0)

Commit aa045d6a changed where drawCursor was called from, and changed the previously existing drawCursor call to operate on QRect(0, 0, 0, 0) so the following calls to draw text still used the right colors, which may have been altered by drawCursor.

(If a block cursor is being used, and we have focus, so the whole block is drawn (when unfocused, an outlined block is drawn), the cursor color may conflict with the text color. The cursor is drawn with either the foreground color or a custom color, and text under the cursor (actually on the text run which starts under the cursor, when "Appearance→Complex Text Layout→Use the same attributes for whole word" is enabled) is drawn with either the background color or another custom color.)

So, move the part of drawCursor that changes the color to use for text under the cursor into its own method, so we don't needlessly draw a dummy cursor at (0,0).

BUG: 462421

Merge request reports