From af03eef4ab3cc41a6148d1f73fef1193f4fc4dcb Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 12 Jan 2017 18:02:46 +0100 Subject: Use qRadiansToDegrees() and qDegreesToRadians() more widely MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ää --- examples/datavisualization/bars/graphmodifier.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/datavisualization/bars/graphmodifier.cpp') 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(), -- cgit v1.2.3