Fix preedit text layout
authorRobin Burchell <robin.burchell@jollamobile.com>
Mon, 4 Nov 2013 13:18:26 +0000 (14:18 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 4 Nov 2013 14:01:30 +0000 (15:01 +0100)
preeditPosition is relative to the block position

Done-with: Aaron Kennedy <aaron.kennedy@jollamobile.com>
Change-Id: If96a1d0939f84ab11f0642d5fe78d786c30f418a
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
src/quick/items/qquicktextnodeengine.cpp

index fe7effa..e9ff70e 100644 (file)
@@ -898,8 +898,8 @@ void QQuickTextNodeEngine::addTextBlock(QTextDocument *textDocument, const QText
             int fragmentEnd = textPos + fragment.length();
 #ifndef QT_NO_IM
             if (preeditPosition >= 0
-                    && preeditPosition >= textPos
-                    && preeditPosition <= fragmentEnd) {
+                    && (preeditPosition + block.position()) >= textPos
+                    && (preeditPosition + block.position()) <= fragmentEnd) {
                 fragmentEnd += preeditLength;
             }
 #endif