diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-04-06 14:56:36 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-04-07 05:48:38 (GMT) |
commit | cdc86d4ba99c71c6145fce9df0b28421d955e487 (patch) | |
tree | 73d5b95751ebbabe7d93ea1ce847f4491a09d141 /src | |
parent | d1284be76fcca238125a9012c59f2babd9bb3879 (diff) | |
download | Qt-cdc86d4ba99c71c6145fce9df0b28421d955e487.zip Qt-cdc86d4ba99c71c6145fce9df0b28421d955e487.tar.gz Qt-cdc86d4ba99c71c6145fce9df0b28421d955e487.tar.bz2 |
Removed usage of NaN in SVG gradients.
The previous change 6c2dd295b2ca2f9125fe072d035a3784ce748718 to remove
usage of NaN in SVG gradients was incomplete. This commit should fix
that.
Task-number: 250146
Reviewed-by: Samuel
(cherry picked from commit 003223dcfc1fa884b82085db19d4c4056bf6eaa0)
Diffstat (limited to 'src')
-rw-r--r-- | src/svg/qsvghandler.cpp | 6 | ||||
-rw-r--r-- | src/svg/qsvgstyle.cpp | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 18ba71c..433a3ad 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -2587,10 +2587,12 @@ static void parseBaseGradient(QSvgNode *node, if (prop && prop->type() == QSvgStyleProperty::GRADIENT) { QSvgGradientStyle *inherited = static_cast<QSvgGradientStyle*>(prop); - if (!inherited->stopLink().isEmpty()) + if (!inherited->stopLink().isEmpty()) { gradProp->setStopLink(inherited->stopLink(), handler->document()); - else + } else { grad->setStops(inherited->qgradient()->stops()); + gradProp->setGradientStopsSet(inherited->gradientStopsSet()); + } matrix = inherited->qmatrix(); } else { diff --git a/src/svg/qsvgstyle.cpp b/src/svg/qsvgstyle.cpp index 4a40bed..b065395 100644 --- a/src/svg/qsvgstyle.cpp +++ b/src/svg/qsvgstyle.cpp @@ -257,7 +257,7 @@ void QSvgGradientStyle::apply(QPainter *p, const QRectF &/*rect*/, QSvgNode *, Q // If the gradient is marked as empty, insert transparent black if (!m_gradientStopsSet) { - m_gradient->setColorAt(0.0, QColor(0, 0, 0, 0)); + m_gradient->setStops(QGradientStops() << QGradientStop(0.0, QColor(0, 0, 0, 0))); m_gradientStopsSet = true; } |