forked from qt-creator/qt-creator
Editor: filter text marks in paintAnnotation
Calculate the correct width for the annotation and decide inside TextMark whether it can be painted or not. This will also make sure that all annotation rectangles are correctly saved in TextEditorWidgetPrivate::updateLineAnnotation. Change-Id: I7e6c606e615b1673a34000618e106efb14184b10 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -4020,8 +4020,13 @@ void TextEditorWidgetPrivate::updateLineAnnotation(const PaintEventData &data,
|
||||
boundingRect = QRectF(x, boundingRect.top(), q->viewport()->width() - x, boundingRect.height());
|
||||
if (boundingRect.isEmpty())
|
||||
break;
|
||||
if (data.eventRect.intersects(boundingRect.toRect()))
|
||||
mark->paintAnnotation(painter, &boundingRect, offset, itemOffset / 2, q->contentOffset());
|
||||
|
||||
mark->paintAnnotation(painter,
|
||||
data.eventRect,
|
||||
&boundingRect,
|
||||
offset,
|
||||
itemOffset / 2,
|
||||
q->contentOffset());
|
||||
|
||||
x = boundingRect.right();
|
||||
offset = itemOffset / 2;
|
||||
|
||||
Reference in New Issue
Block a user