From 9492340ba6397eceaaf08f06b86927e5be221c3d Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 20 Feb 2014 13:16:38 +0100 Subject: [PATCH] Always resize the node geometry on resizes --- src/declarativeimports/core/svgitem.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/declarativeimports/core/svgitem.cpp b/src/declarativeimports/core/svgitem.cpp index 02ae0ce0e..b5dcd7bd1 100644 --- a/src/declarativeimports/core/svgitem.cpp +++ b/src/declarativeimports/core/svgitem.cpp @@ -127,27 +127,32 @@ bool SvgItem::smooth() const QSGNode* SvgItem::updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData* updatePaintNodeData) { Q_UNUSED(updatePaintNodeData); - if (!m_dirty) { - return oldNode; + + if (!window() || !m_svg) { + delete oldNode; + return 0; } QSGSimpleTextureNode *textureNode = static_cast(oldNode); if (!textureNode) { textureNode = new QSGSimpleTextureNode; + m_dirty = true; } - if (window() && m_svg) { + if (m_dirty) { m_svg.data()->resize(width(), height()); m_svg.data()->setContainsMultipleImages(!m_elementID.isEmpty()); - - const QImage image = m_svg.data()->image(m_elementID); - textureNode->setRect(0,0, width(), height()); + const QImage image = m_svg.data()->image(m_elementID); delete m_texture; m_texture = window()->createTextureFromImage(image); textureNode->setTexture(m_texture); + m_dirty = false; } + + textureNode->setRect(0,0, width(), height()); + return textureNode; }