From 6043c639e369c4f233d9c6e0cffe8f3546162624 Mon Sep 17 00:00:00 2001
From: mae <qt-info@nokia.com>
Date: Wed, 4 Nov 2009 12:41:41 +0100
Subject: [PATCH] fix redrawing issue with horizontal scrolling and line
 wrapping column

revby: Oswald Buddenhagen
---
 src/plugins/texteditor/basetexteditor.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 8176f838026..cd406907e03 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -1990,8 +1990,9 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
 
     if (d->m_visibleWrapColumn > 0) {
         lineX = fontMetrics().averageCharWidth() * d->m_visibleWrapColumn + offset.x() + 4;
-        painter.fillRect(QRectF(lineX, 0, viewportRect.width() - lineX, viewportRect.height()),
-                         d->m_ifdefedOutFormat.background());
+        if (lineX < viewportRect.width())
+            painter.fillRect(QRectF(lineX, 0, viewportRect.width() - lineX, viewportRect.height()),
+                             d->m_ifdefedOutFormat.background());
     }
 
 //    // keep right margin clean from full-width selection
-- 
GitLab