Fix positioning of images on new lines in Text elements.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Tue, 3 Jan 2012 03:51:56 +0000 (13:51 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 3 Jan 2012 06:36:26 +0000 (07:36 +0100)
If an image in a text node is at the start of a line include the
relative position of the line when positioning it.

Task-number: QTBUG-23410
Change-Id: Ic9927bf86386374a23acfc6b4478a26f86d43ec6
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/quick/items/qquicktextnode.cpp

index f7ce2d8..fcb1c85 100644 (file)
@@ -629,7 +629,7 @@ namespace {
         QRectF searchRect = rect;
         if (layoutPosition == QTextFrameFormat::InFlow) {
             if (m_currentLineTree.isEmpty()) {
-                searchRect.moveTopLeft(m_position);
+                searchRect.moveTopLeft(m_position + m_currentLine.position());
             } else {
                 const BinaryTreeNode *lastNode = m_currentLineTree.data() + m_currentLineTree.size() - 1;
                 if (lastNode->glyphRun.isRightToLeft()) {