TextEditor: Fix update loop for annotations

Task-number: QTCREATORBUG-19091
Change-Id: I5f699747df10e25d412b2eec4620c3b51ad628e3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2017-10-16 10:42:55 +02:00
parent bf464875f6
commit 79bdd7e14f

View File

@@ -3921,7 +3921,8 @@ void TextEditorWidgetPrivate::drawLineAnnotation(
}
QRect updateRect(lineRect.toRect().topRight(), boundingRect.toRect().bottomRight());
updateRect.setLeft(qMax(0, updateRect.left()));
updateRect.setLeft(qBound(0, updateRect.left(), q->viewport()->width()));
updateRect.setRight(qBound(0, updateRect.right(), q->viewport()->width()));
if (!updateRect.isEmpty() && !eventRect.contains(updateRect))
q->viewport()->update(updateRect);
}