diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/svg/qsvghandler.cpp | 8 | ||||
-rw-r--r-- | src/svg/qsvgstyle.cpp | 7 |
2 files changed, 6 insertions, 9 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: diff --git a/src/svg/qsvgstyle.cpp b/src/svg/qsvgstyle.cpp index e82d89c..aa10a05 100644 --- a/src/svg/qsvgstyle.cpp +++ b/src/svg/qsvgstyle.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. @@ -686,7 +686,6 @@ void QSvgAnimateTransform::revert(QPainter *p, QSvgExtraStates &) void QSvgAnimateTransform::resolveMatrix(const QSvgNode *node) { - static const qreal deg2rad = qreal(0.017453292519943295769); qreal totalTimeElapsed = node->document()->currentElapsed(); if (totalTimeElapsed < m_from || m_finished) return; @@ -786,7 +785,7 @@ void QSvgAnimateTransform::resolveMatrix(const QSvgNode *node) qreal transXDiff = (to1-from1) * percentOfAnimation; qreal transX = from1 + transXDiff; m_transform = QTransform(); - m_transform.shear(qTan(transX * deg2rad), 0); + m_transform.shear(qTan(qDegreesToRadians(transX)), 0); break; } case SkewY: { @@ -801,7 +800,7 @@ void QSvgAnimateTransform::resolveMatrix(const QSvgNode *node) qreal transYDiff = (to1 - from1) * percentOfAnimation; qreal transY = from1 + transYDiff; m_transform = QTransform(); - m_transform.shear(0, qTan(transY * deg2rad)); + m_transform.shear(0, qTan(qDegreesToRadians(transY))); break; } default: |