Commit 671e3eba authored by David Schulz's avatar David Schulz

TextEditor: Use a constant offset for the annotations

Do not check whether a refactoring marker is visible, but always provide
enough space to display one.

Change-Id: I3f9dbb973b9067bd8177773d6fc878b47427232e
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 323bee67
......@@ -3814,14 +3814,8 @@ void TextEditorWidgetPrivate::drawLineAnnotation(QPainter &painter, const QTextB
return mark1->priority() > mark2->priority();
});
constexpr qreal itemOffset = 10;
qreal x = lineRect.right() + itemOffset;
const RefactorMarkers refactorMarkers = m_refactorOverlay->markers();
for (auto refactorMark : refactorMarkers) {
if (refactorMark.cursor.block() == block)
x = qMax(x, refactorMark.rect.right() + itemOffset);
}
const qreal itemOffset = q->fontMetrics().lineSpacing();
qreal x = lineRect.right() + itemOffset * 2;
for (const TextMark *mark : marks) {
QRectF annotationRect(x, lineRect.top(), q->viewport()->width() - x, lineRect.height());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment