TextEditor: Fix determination of maximum width

Width is not zero-based.

Task-number: QTCREATORBUG-19091
Change-Id: I32134727bed204f6bb10748cd067a775f673b89b
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2017-10-17 13:27:03 +02:00
committed by David Schulz
parent 4977c91544
commit 13717262a1

View File

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