summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-06-27 15:40:19 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-06-27 15:40:03 +0000
commit465098088e3dd9bb14e884351f15cffd1471fe2c (patch)
tree87d8e25b48d18cfea0ef05f8604593fecc1f2860 /src/gui/painting
parentfc926985a102e26869ad98abb697e801aef72bd0 (diff)
Harden logic for converting from CSS gradients to QGradient
Some of the gradients from https://webgradients.com/ are not minified completely, so we need to be a bit more lenient when converting them to the internal format used by QGradient. Change-Id: I47466b6a77abd6d2fefc1326fbf6ba5713dd74cb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qbrush.cpp2
-rw-r--r--src/gui/painting/webgradients.binaryjsonbin49052 -> 50792 bytes
2 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index f9331d5cf6..f3a1251c4f 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -1393,7 +1393,7 @@ QGradient::QGradient(Preset preset)
m_data.linear.y2 = end[QLatin1Literal("y")].toDouble();
for (const QJsonValue &stop : presetData[QLatin1String("stops")].toArray()) {
- setColorAt(stop[QLatin1Literal("stop")].toDouble(),
+ setColorAt(stop[QLatin1Literal("position")].toDouble(),
QColor(QRgb(stop[QLatin1Literal("color")].toInt())));
}
diff --git a/src/gui/painting/webgradients.binaryjson b/src/gui/painting/webgradients.binaryjson
index 15b798f7ba..75edd487be 100644
--- a/src/gui/painting/webgradients.binaryjson
+++ b/src/gui/painting/webgradients.binaryjson
Binary files differ