Created attachment 111245 [details] Two screenshots put together, where both widths can be seen The width of the cursor in Kate depends on what column it is in. Most of the times its quite thick, but at some places of the document it's narrower. The column numbers where it is narrow are: 1, 17, 33, 49, 65, 81, 97... (i.e. 16*n+1) It's not a severe bug, but I find it slightly annoying, and the fact that those column numbers follow a mathematical pattern makes it interesting!
The issue is that QTextLayout uses QPainter::RasterOp_NotDestination, which means all pixels that are affected by the cursor rect get inverted. Since the cursor rect is positioned at fractional positions, usually 3 instead of 2 pixels get inverted. I suggest to use setRenderHint(QPainter::Antialiasing, false) for the cursor. This way, the rect rasterization will be pixel-aligned and only the intended 2 pixels get inverted.
I'm able to reproduce this bug and I will try to fix the issue.
For me, the cursor appears thinner only at columns 1, 65, 129, ... Another person reported the same (this was in IRC) I'd like to note that I would prefer this to be fixed in the direction of making the cursor always thinner, rather than always thicker.
Reassigning to affected repository to help juniors finding the code.
Created attachment 113095 [details] attachment-19378-0.html Thank you C feck, I was trying to find the bug in Kate for 3 days:( On Tue, Jun 5, 2018 at 1:13 AM, Christoph Feck <bugzilla_noreply@kde.org> wrote: > https://bugs.kde.org/show_bug.cgi?id=391518 > > Christoph Feck <cfeck@kde.org> changed: > > What |Removed |Added > ------------------------------------------------------------ > ---------------- > Product|kate |frameworks-ktexteditor > Version|17.12.0 |unspecified > Component|general |general > > --- Comment #4 from Christoph Feck <cfeck@kde.org> --- > Reassigning to affected repository to help juniors finding the code. > > -- > You are receiving this mail because: > You are on the CC list for the bug. > You are the assignee for the bug. >
Git commit e6f87dd570082eb7f636b92f6ca88d85763ae687 by Sven Brauch, on behalf of Shubham Jangra. Committed on 07/06/2018 at 07:07. Pushed by brauch into branch 'master'. Fix caret width Differential Revision: https://phabricator.kde.org/D13365 M +1 -0 src/render/katerenderer.cpp https://commits.kde.org/ktexteditor/e6f87dd570082eb7f636b92f6ca88d85763ae687