diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-04-06 14:56:36 (GMT) |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-04-06 15:03:02 (GMT) |
commit | 003223dcfc1fa884b82085db19d4c4056bf6eaa0 (patch) | |
tree | 7e7c7ad3c5fd95e9b0a519b2b140edc9ec241f32 | |
parent | fc0a71e4b4e4ce1e0f57c6d7be6bd9d935062fc2 (diff) | |
download | Qt-003223dcfc1fa884b82085db19d4c4056bf6eaa0.zip Qt-003223dcfc1fa884b82085db19d4c4056bf6eaa0.tar.gz Qt-003223dcfc1fa884b82085db19d4c4056bf6eaa0.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
-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; } |