summaryrefslogtreecommitdiffstats
path: root/src/svg/qsvgstyle.cpp
diff options
context:
space:
mode:
authorSuneel BS <suneel.b-s@nokia.com>2009-05-08 05:39:45 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-07-01 13:19:03 (GMT)
commit7ab895f576b8ef8380838778958fae651a550f79 (patch)
tree633f3f37bc97e8d18f222f4b0a48ce781d11501a /src/svg/qsvgstyle.cpp
parent1d32cdf73843ba98104fdbc6d5d0a296dbb689b0 (diff)
downloadQt-7ab895f576b8ef8380838778958fae651a550f79.zip
Qt-7ab895f576b8ef8380838778958fae651a550f79.tar.gz
Qt-7ab895f576b8ef8380838778958fae651a550f79.tar.bz2
Fixed inheritance of some attributes in SVG.
Fixed inheritance of stroke attributes, the font-size and text-anchor attribute. Autotest added by Kim. Reviewed-by: Kim
Diffstat (limited to 'src/svg/qsvgstyle.cpp')
-rw-r--r--src/svg/qsvgstyle.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/svg/qsvgstyle.cpp b/src/svg/qsvgstyle.cpp
index fec6231..556201b 100644
--- a/src/svg/qsvgstyle.cpp
+++ b/src/svg/qsvgstyle.cpp
@@ -195,14 +195,18 @@ void QSvgFontStyle::revert(QPainter *p, QSvgExtraStates &)
}
QSvgStrokeStyle::QSvgStrokeStyle(const QPen &pen)
- : m_stroke(pen)
+ : m_stroke(pen), m_strokePresent(true)
{
}
void QSvgStrokeStyle::apply(QPainter *p, const QRectF &, QSvgNode *, QSvgExtraStates &)
{
m_oldStroke = p->pen();
- p->setPen(m_stroke);
+ if (!m_strokePresent || !m_stroke.widthF() || !m_stroke.color().alphaF()) {
+ p->setPen(Qt::NoPen);
+ } else {
+ p->setPen(m_stroke);
+ }
}
void QSvgStrokeStyle::revert(QPainter *p, QSvgExtraStates &)