diff options
author | Suneel BS <suneel.b-s@nokia.com> | 2009-05-07 14:42:04 (GMT) |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-06-22 13:26:19 (GMT) |
commit | d910b0c8a184ed53531c80deb26b27dd762c133e (patch) | |
tree | a3754b7765673067c6eb2484d16ccb4082cfab6d /src/svg/qsvgtinydocument.cpp | |
parent | d6daae2c0dbab5c547f4bdec2d3bafe3a5ed62b6 (diff) | |
download | Qt-d910b0c8a184ed53531c80deb26b27dd762c133e.zip Qt-d910b0c8a184ed53531c80deb26b27dd762c133e.tar.gz Qt-d910b0c8a184ed53531c80deb26b27dd762c133e.tar.bz2 |
Fixed bug in the SVG module where display="none" was not respected.
Elements with display="none" should not be rendered. Modified and
autotest added by Kim.
Reviewed-by: Kim
Diffstat (limited to 'src/svg/qsvgtinydocument.cpp')
-rw-r--r-- | src/svg/qsvgtinydocument.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp index de214bb..3058569 100644 --- a/src/svg/qsvgtinydocument.cpp +++ b/src/svg/qsvgtinydocument.cpp @@ -231,8 +231,10 @@ 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); @@ -244,7 +246,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 +264,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(); |