aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextedit.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-04-13 09:46:15 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-04-13 09:46:15 +0200
commit4b72f48637a87c95deedcc501cd9cc8f717117fa (patch)
tree80f00ade2cc3f3845e0f309f39a2649040d203e3 /src/quick/items/qquicktextedit.cpp
parent3d30c6d7b40ce86f49bc7bdc5c2c74ce180bb3dd (diff)
parentf7e1f7b2f1f1577fd94dfffb93ef15ded5d09031 (diff)
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts: src/quick/util/qquickpixmapcache.cpp tests/auto/quick/qquickwindow/BLACKLIST Change-Id: Ie81612f2884f8ea508c48ba2735ec54ea1c2eca5
Diffstat (limited to 'src/quick/items/qquicktextedit.cpp')
-rw-r--r--src/quick/items/qquicktextedit.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index 29300644b9..e10aec229e 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -1890,6 +1890,10 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
int currentNodeSize = 0;
int nodeStart = firstDirtyPos;
QPointF basePosition(d->xoff, d->yoff);
+ QMatrix4x4 basePositionMatrix;
+ basePositionMatrix.translate(basePosition.x(), basePosition.y());
+ rootNode->setMatrix(basePositionMatrix);
+
QPointF nodeOffset;
TextNode *firstCleanNode = (nodeIterator != d->textNodeMap.end()) ? *nodeIterator : 0;
@@ -1901,7 +1905,6 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
frames.append(textFrame->childFrames());
rootNode->frameDecorationsNode->m_engine->addFrameDecorations(d->document, textFrame);
-
if (textFrame->lastPosition() < firstDirtyPos || (firstCleanNode && textFrame->firstPosition() >= firstCleanNode->startPos()))
continue;
node = d->createTextNode();
@@ -1922,7 +1925,7 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
nodeOffset = d->document->documentLayout()->frameBoundingRect(textFrame).topLeft();
updateNodeTransform(node, nodeOffset);
while (!it.atEnd())
- node->m_engine->addTextBlock(d->document, (it++).currentBlock(), basePosition - nodeOffset, d->color, QColor(), selectionStart(), selectionEnd() - 1);
+ node->m_engine->addTextBlock(d->document, (it++).currentBlock(), -nodeOffset, d->color, QColor(), selectionStart(), selectionEnd() - 1);
nodeStart = textFrame->firstPosition();
} else {
// Having nodes spanning across frame boundaries will break the current bookkeeping mechanism. We need to prevent that.
@@ -1945,7 +1948,7 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
nodeStart = block.position();
}
- node->m_engine->addTextBlock(d->document, block, basePosition - nodeOffset, d->color, QColor(), selectionStart(), selectionEnd() - 1);
+ node->m_engine->addTextBlock(d->document, block, -nodeOffset, d->color, QColor(), selectionStart(), selectionEnd() - 1);
currentNodeSize += block.length();
if ((it.atEnd()) || (firstCleanNode && block.next().position() >= firstCleanNode->startPos())) // last node that needed replacing or last block of the frame
@@ -1989,7 +1992,7 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
if (d->cursorComponent == 0 && !isReadOnly()) {
QSGRectangleNode* cursor = 0;
if (d->cursorVisible && d->control->cursorOn())
- cursor = d->sceneGraphContext()->createRectangleNode(cursorRectangle(), d->color);
+ cursor = d->sceneGraphContext()->createRectangleNode(d->control->cursorRect(), d->color);
rootNode->resetCursorNode(cursor);
}