[FrameSvgItem] Iterate child nodes properly
Documentation says "Children are stored internally as a linked list, so iterating over the children via the index is suboptimal." Differential Revision: https://phabricator.kde.org/D8046
This commit is contained in:
parent
9e7d02cde2
commit
bb6b170516
@ -528,9 +528,10 @@ QSGNode *FrameSvgItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaint
|
||||
FrameNode* frameNode = static_cast<FrameNode*>(oldNode);
|
||||
QSize frameSize(width(), height());
|
||||
QRect geometry = frameNode->contentsRect(frameSize);
|
||||
for(int i = 0; i<oldNode->childCount(); ++i) {
|
||||
FrameItemNode* it = static_cast<FrameItemNode*>(oldNode->childAtIndex(i));
|
||||
it->reposition(geometry, frameSize);
|
||||
QSGNode *node = oldNode->firstChild();
|
||||
while (node) {
|
||||
static_cast<FrameItemNode *>(node)->reposition(geometry, frameSize);
|
||||
node = node->nextSibling();
|
||||
}
|
||||
|
||||
m_sizeChanged = false;
|
||||
|
Loading…
Reference in New Issue
Block a user