summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2018-05-24 16:21:53 +0200
committerMitch Curtis <mitch.curtis@qt.io>2018-05-29 12:07:29 +0000
commit7eb6f79f5d98be6a0c6aa437b10d927c923ce056 (patch)
treec36f4e85066a61791ec2c38853b1c506d79bd576
parent4aec7d14d57b10f7fc503644d3cad44d9f166322 (diff)
downloadqtquickcontrols-7eb6f79f5d98be6a0c6aa437b10d927c923ce056.tar.gz
Extras: fix remaining createRadialGradient() issues
be4c4877b35ad1b6983cf194e61f0dad1d123af5 fixed Context2D's createRadialGradient() function, so our usage of it has to be updated accordingly. This patch produces the same visual result as it was originally. Change-Id: I4c021dcb2db9303d0a4d6ae8ca4cc606ca1f6d67 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
-rw-r--r--examples/quickcontrols/extras/dashboard/qml/DashboardGaugeStyle.qml2
-rw-r--r--src/controls/Styles/Base/HandleStyleHelper.qml4
-rw-r--r--src/extras/Private/CircularButtonStyleHelper.qml6
3 files changed, 6 insertions, 6 deletions
diff --git a/examples/quickcontrols/extras/dashboard/qml/DashboardGaugeStyle.qml b/examples/quickcontrols/extras/dashboard/qml/DashboardGaugeStyle.qml
index feb85a5f..d8340846 100644
--- a/examples/quickcontrols/extras/dashboard/qml/DashboardGaugeStyle.qml
+++ b/examples/quickcontrols/extras/dashboard/qml/DashboardGaugeStyle.qml
@@ -101,7 +101,7 @@ CircularGaugeStyle {
ctx.stroke();
ctx.beginPath();
- var gradient = ctx.createRadialGradient(xCenter, yCenter, outerRadius * 0.8, xCenter, yCenter, outerRadius);
+ var gradient = ctx.createRadialGradient(xCenter, yCenter, 0, xCenter, yCenter, outerRadius * 1.5);
gradient.addColorStop(0, Qt.rgba(1, 1, 1, 0));
gradient.addColorStop(0.7, Qt.rgba(1, 1, 1, 0.13));
gradient.addColorStop(1, Qt.rgba(1, 1, 1, 1));
diff --git a/src/controls/Styles/Base/HandleStyleHelper.qml b/src/controls/Styles/Base/HandleStyleHelper.qml
index 30e62d79..78059bfe 100644
--- a/src/controls/Styles/Base/HandleStyleHelper.qml
+++ b/src/controls/Styles/Base/HandleStyleHelper.qml
@@ -67,8 +67,8 @@ QtObject {
}
ctx.beginPath();
- var gradient = ctx.createRadialGradient(handleX, handleY, handleWidth / 2,
- handleX, handleY, handleWidth);
+ var gradient = ctx.createRadialGradient(handleX, handleY, 0,
+ handleX, handleY, handleWidth * 1.5);
gradient.addColorStop(0, handleColorTop);
gradient.addColorStop(handleColorBottomStop, handleColorBottom);
ctx.ellipse(handleX, handleY, handleWidth, handleHeight);
diff --git a/src/extras/Private/CircularButtonStyleHelper.qml b/src/extras/Private/CircularButtonStyleHelper.qml
index 55154ae2..713d727f 100644
--- a/src/extras/Private/CircularButtonStyleHelper.qml
+++ b/src/extras/Private/CircularButtonStyleHelper.qml
@@ -96,7 +96,7 @@ QtObject {
ctx.lineWidth = outerArcLineWidth;
ctx.arc(xCenter, yCenter, outerArcRadius, 0, Math.PI * 2, false);
var gradient = ctx.createRadialGradient(xCenter, yCenter - halfRadius,
- halfRadius, xCenter, yCenter - halfRadius, radius);
+ 0, xCenter, yCenter - halfRadius, radius * 1.5);
gradient.addColorStop(0, outerArcColorTop);
gradient.addColorStop(1, outerArcColorBottom);
ctx.strokeStyle = gradient;
@@ -126,8 +126,8 @@ QtObject {
/* Draw the button's body */
ctx.beginPath();
ctx.ellipse(xCenter - radius, yCenter - radius, radius * 2, radius * 2);
- gradient = ctx.createRadialGradient(xCenter, yCenter + radius * 0.85, radius,
- xCenter, yCenter + radius * 0.85, radius * 0.85);
+ gradient = ctx.createRadialGradient(xCenter, yCenter + radius * 0.85, 0,
+ xCenter, yCenter + radius * 0.85, radius * (0.85 * 2));
gradient.addColorStop(1, buttonColorTop);
gradient.addColorStop(0, buttonColorBottom);
ctx.fillStyle = gradient;