TextEditor: Simplify annotation rectangle computation

Change-Id: Ie04f545d24696d66645c367b2c25d643c3691908
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
David Schulz
2017-07-05 11:09:07 +02:00
parent a196170df9
commit 862dd4c6bf
3 changed files with 41 additions and 23 deletions

View File

@@ -3821,7 +3821,7 @@ void TextEditorWidgetPrivate::drawLineAnnotation(QPainter &painter, const QTextB
QRectF annotationRect(x, lineRect.top(), q->viewport()->width() - x, lineRect.height());
if (annotationRect.width() <= 0)
break;
mark->paintAnnotation(&painter, &annotationRect, q->fontMetrics());
mark->paintAnnotation(&painter, &annotationRect);
x += annotationRect.width() + itemOffset;
m_annotationRects[block.blockNumber()].append({annotationRect, mark});
}