forked from qt-creator/qt-creator
Editor: only paint the preedit cursor
Task-number: QTCREATORBUG-29134 Change-Id: Ia44b0c8ddc88da7b64527fea806139726d57243a Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -4956,15 +4956,15 @@ void TextEditorWidget::paintEvent(QPaintEvent *e)
|
||||
|
||||
paintBlock(&painter, data.block, data.offset, blockData.selections, data.eventRect);
|
||||
|
||||
if (data.isEditable && data.context.cursorPosition < -1
|
||||
&& !blockData.layout->preeditAreaText().isEmpty()) {
|
||||
const int cursorPos = blockData.layout->preeditAreaPosition()
|
||||
- (data.context.cursorPosition + 2);
|
||||
data.cursors.append(generateCursorData(cursorPos, data, blockData, painter));
|
||||
}
|
||||
|
||||
if (drawCursor && !drawCursorAsBlock)
|
||||
if (data.isEditable && !blockData.layout->preeditAreaText().isEmpty()) {
|
||||
if (data.context.cursorPosition < -1) {
|
||||
const int cursorPos = blockData.layout->preeditAreaPosition()
|
||||
- (data.context.cursorPosition + 2);
|
||||
data.cursors = {generateCursorData(cursorPos, data, blockData, painter)};
|
||||
}
|
||||
} else if (drawCursor && !drawCursorAsBlock) {
|
||||
d->addCursorsPosition(data, painter, blockData);
|
||||
}
|
||||
d->paintIndentDepth(data, painter, blockData);
|
||||
d->paintAdditionalVisualWhitespaces(data, painter, blockData.boundingRect.top());
|
||||
d->paintReplacement(data, painter, blockData.boundingRect.top());
|
||||
|
||||
Reference in New Issue
Block a user