aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickdial.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicktemplates2/qquickdial.cpp')
-rw-r--r--src/quicktemplates2/qquickdial.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickdial.cpp b/src/quicktemplates2/qquickdial.cpp
index af02fd6f..7f73d399 100644
--- a/src/quicktemplates2/qquickdial.cpp
+++ b/src/quicktemplates2/qquickdial.cpp
@@ -75,7 +75,9 @@ QT_BEGIN_NAMESPACE
\sa {Customizing Dial}, {Input Controls}
*/
+static const qreal startAngleRadians = (M_PI * 2.0) * (4.0 / 6.0);
static const qreal startAngle = -140;
+static const qreal endAngleRadians = (M_PI * 2.0) * (5.0 / 6.0);
static const qreal endAngle = 140;
class QQuickDialPrivate : public QQuickControlPrivate
@@ -135,7 +137,7 @@ qreal QQuickDialPrivate::positionAt(const QPoint &point) const
if (angle < M_PI / -2)
angle = angle + M_PI * 2;
- qreal normalizedAngle = (M_PI * 4 / 3 - angle) / (M_PI * 10 / 6);
+ qreal normalizedAngle = (startAngleRadians - angle) / endAngleRadians;
return normalizedAngle;
}