Editor: fix continuosly repainting partially visible annotations

Task-number: QTCREATORBUG-20422
Change-Id: Id171d8cb3022dd6e345e55fdf029c445bc42c382
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2018-05-28 14:46:36 +02:00
parent c1c57f0c38
commit 3e618cbf76

View File

@@ -4131,7 +4131,7 @@ void TextEditorWidgetPrivate::updateLineAnnotation(const PaintEventData &data,
QRect updateRect(lineRect.toRect().topRight(), boundingRect.toRect().bottomRight());
updateRect.setLeft(qBound(0, updateRect.left(), q->viewport()->width() - 1));
updateRect.setRight(qBound(0, updateRect.right(), q->viewport()->width() - 1));
if (!updateRect.isEmpty() && !data.eventRect.contains(updateRect))
if (!updateRect.isEmpty() && !data.eventRect.contains(q->viewport()->rect() & updateRect))
q->viewport()->update(updateRect);
}