forked from qt-creator/qt-creator
TextEditor: fix painting annotations
The painting of annotations for one line will be aborted as soon as we hit the first text mark that returns an empty bounding rect for the annotation. This results in no painting at all when having a line with multiple text marks with and without annotation. Prefilter the text marks to make sure we only try to paint text marks with an annotation. Change-Id: I4f07127fafe935b2ad4ed418b326b6f2ab5b1c50 Fixes: QTCREATORBUG-21628 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -4106,12 +4106,12 @@ void TextEditorWidgetPrivate::updateLineAnnotation(const PaintEventData &data,
|
||||
if (!blockUserData)
|
||||
return;
|
||||
|
||||
TextMarks marks = blockUserData->marks();
|
||||
|
||||
const bool annotationsVisible = Utils::anyOf(marks, [](const TextMark* mark) {
|
||||
TextMarks marks = Utils::filtered(blockUserData->marks(), [](const TextMark* mark){
|
||||
return !mark->lineAnnotation().isEmpty();
|
||||
});
|
||||
|
||||
const bool annotationsVisible = !marks.isEmpty();
|
||||
|
||||
if (updateAnnotationBounds(blockUserData, data.documentLayout, annotationsVisible)
|
||||
|| !annotationsVisible) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user