diff options
Diffstat (limited to 'src/svg/qsvgtinydocument.cpp')
-rw-r--r-- | src/svg/qsvgtinydocument.cpp | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp index 993bf3d..54459d5 100644 --- a/src/svg/qsvgtinydocument.cpp +++ b/src/svg/qsvgtinydocument.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtSvg module of the Qt Toolkit. @@ -21,9 +20,10 @@ ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. @@ -61,10 +61,12 @@ QT_BEGIN_NAMESPACE QSvgTinyDocument::QSvgTinyDocument() - : QSvgStructureNode(0), - m_animated(false), - m_animationDuration(0), - m_fps(30) + : QSvgStructureNode(0) + , m_widthPercent(false) + , m_heightPercent(false) + , m_animated(false) + , m_animationDuration(0) + , m_fps(30) { } @@ -231,12 +233,16 @@ void QSvgTinyDocument::draw(QPainter *p, const QRectF &bounds) m_time.start(); } - p->save(); + if (displayMode() == QSvgNode::NoneMode) + return; + p->save(); //sets default style on the painter //### not the most optimal way mapSourceToTarget(p, bounds); - p->setPen(Qt::NoPen); + QPen pen(Qt::NoBrush, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin); + pen.setMiterLimit(4); + p->setPen(pen); p->setBrush(Qt::black); p->setRenderHint(QPainter::Antialiasing); p->setRenderHint(QPainter::SmoothPixmapTransform); @@ -244,7 +250,7 @@ void QSvgTinyDocument::draw(QPainter *p, const QRectF &bounds) applyStyle(p, m_states); while (itr != m_renderers.end()) { QSvgNode *node = *itr; - if (node->isVisible()) + if ((node->isVisible()) && (node->displayMode() != QSvgNode::NoneMode)) node->draw(p, m_states); ++itr; } @@ -262,6 +268,12 @@ void QSvgTinyDocument::draw(QPainter *p, const QString &id, qDebug("Couldn't find node %s. Skipping rendering.", qPrintable(id)); return; } + if (m_time.isNull()) { + m_time.start(); + } + + if (node->displayMode() == QSvgNode::NoneMode) + return; p->save(); @@ -271,7 +283,9 @@ void QSvgTinyDocument::draw(QPainter *p, const QString &id, QTransform originalTransform = p->worldTransform(); //XXX set default style on the painter - p->setPen(Qt::NoPen); + QPen pen(Qt::NoBrush, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin); + pen.setMiterLimit(4); + p->setPen(pen); p->setBrush(Qt::black); p->setRenderHint(QPainter::Antialiasing); p->setRenderHint(QPainter::SmoothPixmapTransform); |