From 9ec55210c300ca9f2c302b5a19cd540bc08dcddb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com>
Date: Thu, 26 Nov 2009 16:34:14 +0100
Subject: [PATCH] Set the brush origin in the BaseTextEditor for the
 WaveUnderlines

This is necessary since a recent change in Qt 4.6 to how the
WaveUnderline is drawn. It makes sure the WaveUnderline repeats
correctly from one text item to another.

Reviewed-by: mae
---
 src/plugins/texteditor/basetexteditor.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 278ea7f0f20..8471ec947b9 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -1995,6 +1995,9 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
                              d->m_ifdefedOutFormat.background());
     }
 
+    // Set a brush origin so that the WaveUnderline knows where the wave started
+    painter.setBrushOrigin(offset);
+
 //    // keep right margin clean from full-width selection
 //    int maxX = offset.x() + qMax((qreal)viewportRect.width(), documentLayout->documentSize().width())
 //               - doc->documentMargin();
-- 
GitLab