Draw caret ourselves
Drawing caret ourselves helps solve a few issues:
- With custom line height, the caret is no longer smaller than line
- Cursor direction depends on the block content, not keyboard layout (bug 172630). Our own cursor will not draw the direction marker and thus will avoid this issue
- Make cursor insertion point a few pixels larger vertically (bug 452853). You can just increase the line height and the caret will be bigger :) Technically, this is not exactly what is requested, but it works. Making Cursor visually larger than the line is possible but it means that now we need to always dirty 3 lines for repaint: current line, line above, line below which is a lot of uneeded work for such a small thing. So this will do.
It is also more efficient than the Qt implementation as the work done in here is a lot less.
--
A second commit fixes space painting with custom line height. Incorrect font ascent value was being used in paintTextLine.