From e9be9a0d57926a6aaf8c6eaa3a50895c4a51a09c Mon Sep 17 00:00:00 2001
From: mae <qt-info@nokia.com>
Date: Tue, 13 Apr 2010 14:37:54 +0200
Subject: [PATCH] Fix minor ifdefed-out block drawing issue

When drawing the background for an ifdefed-out block, expand
to the end of the visible viewport, even when scrolled
horizontally to the right.
---
 src/plugins/texteditor/basetexteditor.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index e4489414797..1599e6790dd 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -2569,7 +2569,7 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
 
             if (TextEditDocumentLayout::ifdefedOut(block)) {
                 QRectF rr = r;
-                rr.setWidth(viewport()->width());
+                rr.setRight(viewportRect.width() - offset.x());
                 if (lineX > 0)
                     rr.setRight(qMin(lineX, rr.right()));
                 painter.fillRect(rr, d->m_ifdefedOutFormat.background());
-- 
GitLab