diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-09-08 09:32:26 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-09-10 17:15:40 +0200 |
commit | 72338c12bc98ac1ad139436bedd422d61dd68291 (patch) | |
tree | 022f7cd0f0722c10a3a089a01c38ede4815ff4c3 /src/gui | |
parent | c942bae4ebf903a60a8bd3da9500f7733c71b04d (diff) |
Use qmath.h's conversions between degrees and radians
The make the semantics overt and avoid the joys of yet another
approximation to pi/180 hard-coded in our source-code.
Change-Id: I9dcbaada2e7de119e385fc7056bc601ecd59311a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qtransform.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 7d057732c7..6e3adb6702 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. @@ -569,7 +569,6 @@ QTransform & QTransform::shear(qreal sh, qreal sv) return *this; } -const qreal deg2rad = qreal(0.017453292519943295769); // pi/180 const qreal inv_dist_to_plane = 1. / 1024.; /*! @@ -606,7 +605,7 @@ QTransform & QTransform::rotate(qreal a, Qt::Axis axis) else if (a == 180.) cosa = -1.; else{ - qreal b = deg2rad*a; // convert to radians + qreal b = qDegreesToRadians(a); sina = qSin(b); // fast and convenient cosa = qCos(b); } |