From 6968ab8117cbf46bf378cba1bbdc82c9d59359e3 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 28 Feb 2014 15:57:11 +0100 Subject: [PATCH] Set filtering so SVG's look nice and smooth --- src/declarativeimports/core/svgitem.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/declarativeimports/core/svgitem.cpp b/src/declarativeimports/core/svgitem.cpp index 0214442e1..d58499215 100644 --- a/src/declarativeimports/core/svgitem.cpp +++ b/src/declarativeimports/core/svgitem.cpp @@ -151,6 +151,7 @@ QSGNode *SvgItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updateP SVGTextureNode *textureNode = static_cast(oldNode); if (!textureNode) { textureNode = new SVGTextureNode; + textureNode->setFiltering(QSGTexture::Linear); m_textureChanged = true; } @@ -163,6 +164,9 @@ QSGNode *SvgItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updateP m_svg.data()->setContainsMultipleImages(!m_elementID.isEmpty()); const QImage image = m_svg.data()->image(QSize(width(), height()), m_elementID); QSGTexture *texture = window()->createTextureFromImage(image); + if (m_smooth) { + texture->setFiltering(QSGTexture::Linear); + } textureNode->setTexture(texture); m_textureChanged = false;