forked from qt-creator/qt-creator
TextEditor: Optimize line annotation painting
Paint an annotation only if the event rectangle contains the block for that specific annotation Change-Id: I5f992f916da25268dd2c9e6b4703701934c8551d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -4408,6 +4408,8 @@ void TextEditorWidget::paintEvent(QPaintEvent *e)
|
||||
|| d->m_blockSelection.positionColumn == d->m_blockSelection.anchorColumn)
|
||||
&& blockSelectionCursorRect.isValid())
|
||||
painter.fillRect(blockSelectionCursorRect, palette().text());
|
||||
|
||||
d->drawLineAnnotation(painter, block, lineX < viewportRect.width() ? lineX : 0);
|
||||
}
|
||||
|
||||
offset.ry() += r.height();
|
||||
@@ -4554,7 +4556,6 @@ void TextEditorWidget::paintEvent(QPaintEvent *e)
|
||||
painter.restore();
|
||||
}
|
||||
}
|
||||
d->drawLineAnnotation(painter, block, lineX < viewportRect.width() ? lineX : 0);
|
||||
|
||||
block = nextVisibleBlock;
|
||||
top = bottom;
|
||||
|
||||
Reference in New Issue
Block a user