forked from qt-creator/qt-creator
Editor: centralize annotation filtering
Change-Id: I68464b14b44beee772ace93f7bdebc32ae3325ef Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -3970,7 +3970,7 @@ void TextEditorWidgetPrivate::updateLineAnnotation(const PaintEventData &data,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
TextMarks marks = Utils::filtered(blockUserData->marks(), [](const TextMark* mark){
|
TextMarks marks = Utils::filtered(blockUserData->marks(), [](const TextMark* mark){
|
||||||
return !mark->lineAnnotation().isEmpty();
|
return !mark->lineAnnotation().isEmpty() && mark->isVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
const bool annotationsVisible = !marks.isEmpty();
|
const bool annotationsVisible = !marks.isEmpty();
|
||||||
@@ -4015,8 +4015,6 @@ void TextEditorWidgetPrivate::updateLineAnnotation(const PaintEventData &data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const TextMark *mark : qAsConst(marks)) {
|
for (const TextMark *mark : qAsConst(marks)) {
|
||||||
if (!mark->isVisible())
|
|
||||||
continue;
|
|
||||||
boundingRect = QRectF(x, boundingRect.top(), q->viewport()->width() - x, boundingRect.height());
|
boundingRect = QRectF(x, boundingRect.top(), q->viewport()->width() - x, boundingRect.height());
|
||||||
if (boundingRect.isEmpty())
|
if (boundingRect.isEmpty())
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user