summaryrefslogtreecommitdiff
path: root/src/svg/qsvghandler.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-09-08 16:19:01 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2021-09-09 15:58:46 +0200
commit6f4539075cdcecce2eb888f4fac566d26d5de951 (patch)
tree3f8ceb6368b8d029037fdf2823f3236bdc27923a /src/svg/qsvghandler.cpp
parentf890cc7b639faeacfd207966d4e484f421c0037b (diff)
downloadqtsvg-6f4539075cdcecce2eb888f4fac566d26d5de951.tar.gz
Use qDegreesToRadians() rather than hand-rolled arithmetic
Doing so saves yet another approximation to pi/180 and spells out the semantics. Change-Id: Ied1bb9aa650a9535862622f891b716943de54cec Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/svg/qsvghandler.cpp')
-rw-r--r--src/svg/qsvghandler.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index f2757bd..300979e 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.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 Qt SVG module of the Qt Toolkit.
@@ -1177,13 +1177,11 @@ static QTransform parseTransformationMatrix(QStringView value)
} else if (state == SkewX) {
if (points.count() != 1)
goto error;
- const qreal deg2rad = qreal(0.017453292519943295769);
- matrix.shear(qTan(points[0]*deg2rad), 0);
+ matrix.shear(qTan(qDegreesToRadians(points[0])), 0);
} else if (state == SkewY) {
if (points.count() != 1)
goto error;
- const qreal deg2rad = qreal(0.017453292519943295769);
- matrix.shear(0, qTan(points[0]*deg2rad));
+ matrix.shear(0, qTan(qDegreesToRadians(points[0])));
}
}
error: