diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2017-01-12 18:02:46 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2017-06-14 08:21:29 +0000 |
commit | af03eef4ab3cc41a6148d1f73fef1193f4fc4dcb (patch) | |
tree | ccedb2a89986524e00a374f21ffb77b8b37dba38 /examples/datavisualization/bars/graphmodifier.cpp | |
parent | 53fcf914e278ed4395a4873af2b64272c5d7882c (diff) |
Use qRadiansToDegrees() and qDegreesToRadians() more widely
These document what the arithmetic is actually doing; and save us an
ad-hoc use of an approximate value for pi while we're about it.
Task-number: QTBUG-58083
Change-Id: I82c5502af724b33ec598c5a9da76537f93a95eac
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'examples/datavisualization/bars/graphmodifier.cpp')
-rw-r--r-- | examples/datavisualization/bars/graphmodifier.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/datavisualization/bars/graphmodifier.cpp b/examples/datavisualization/bars/graphmodifier.cpp index 8ef1c536..a130b0ff 100644 --- a/examples/datavisualization/bars/graphmodifier.cpp +++ b/examples/datavisualization/bars/graphmodifier.cpp @@ -353,7 +353,7 @@ void GraphModifier::zoomToSelectedBar() // Rotate the camera so that it always points approximately to the graph center //! [15] - qreal endAngleX = qAtan(qreal(endTarget.z() / endTarget.x())) / M_PI * -180.0 + 90.0; + qreal endAngleX = 90.0 - qRadiansToDegrees(qAtan(qreal(endTarget.z() / endTarget.x()))); if (endTarget.x() > 0.0f) endAngleX -= 180.0f; float barValue = m_graph->selectedSeries()->dataProxy()->itemAt(selectedBar.x(), |