summaryrefslogtreecommitdiffstats
path: root/src/svg/qsvghandler.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-04-07 06:16:59 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-04-07 06:16:59 (GMT)
commitcbec6d9481bf8f55834eafac4eca53f85206b240 (patch)
tree9875b3dd5a87c0274ee0d57f541f836598936f2b /src/svg/qsvghandler.cpp
parentbe8b6047ccd43df1127beb4c602c58408ff9b612 (diff)
parent939623b2bc8e441618ee1a1886cc656880bee62b (diff)
downloadQt-cbec6d9481bf8f55834eafac4eca53f85206b240.zip
Qt-cbec6d9481bf8f55834eafac4eca53f85206b240.tar.gz
Qt-cbec6d9481bf8f55834eafac4eca53f85206b240.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into windows-7-multitouch
Diffstat (limited to 'src/svg/qsvghandler.cpp')
-rw-r--r--src/svg/qsvghandler.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index 56dab5f..18ba71c 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -2649,7 +2649,6 @@ static QSvgStyleProperty *createLinearGradientNode(QSvgNode *node,
}
QLinearGradient *grad = new QLinearGradient(nx1, ny1, nx2, ny2);
- grad->setColorAt(qQNaN(), QColor());
grad->setInterpolationMode(QGradient::ComponentInterpolation);
QSvgGradientStyle *prop = new QSvgGradientStyle(grad);
parseBaseGradient(node, attributes, prop, handler);
@@ -2783,7 +2782,6 @@ static QSvgStyleProperty *createRadialGradientNode(QSvgNode *node,
nfy = toDouble(fy);
QRadialGradient *grad = new QRadialGradient(ncx, ncy, nr, nfx, nfy);
- grad->setColorAt(qQNaN(), QColor());
grad->setInterpolationMode(QGradient::ComponentInterpolation);
QSvgGradientStyle *prop = new QSvgGradientStyle(grad);
@@ -2929,12 +2927,9 @@ static bool parseStopNode(QSvgStyleProperty *parent,
QGradient *grad = style->qgradient();
offset = qMin(qreal(1), qMax(qreal(0), offset)); // Clamp to range [0, 1]
- QGradientStops stops = grad->stops();
- // Check if the gradient is marked as empty (marked with one single stop at NaN).
- if ((stops.size() == 1) && qIsNaN(stops.at(0).first)) {
- stops.clear();
- grad->setStops(stops);
- } else {
+ QGradientStops stops;
+ if (style->gradientStopsSet()) {
+ stops = grad->stops();
// If the stop offset equals the one previously added, add an epsilon to make it greater.
if (offset <= stops.back().first)
offset = stops.back().first + FLT_EPSILON;
@@ -2950,6 +2945,7 @@ static bool parseStopNode(QSvgStyleProperty *parent,
}
grad->setColorAt(offset, color);
+ style->setGradientStopsSet(true);
if (!colorOK)
style->addResolve(offset);
return true;