summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorpragat-pandya <pragat.pandya@gmail.com>2022-02-01 05:59:42 +0530
committerHossein <hossein@libreoffice.org>2022-02-15 12:17:50 +0100
commit5f21eaa0e6b689233336cacc949b9a55d545088f (patch)
treea0f892e0c3a1b738c3e59e934a48b326891714ca /starmath
parent22d09d65c0e61cac1fa27af6a04a23e16f97c907 (diff)
tdf#145759 Using M_PI from cmath instead of magic constants.
Replace the instances of Pi's value as magic number by M_PI Use M_PI_2 and 2_M_PI instead of calculating these values in code. Use basegfx functions to convert angle units. Change-Id: I6cca7cc93704a70ccf3a0571a56a789bc9df51ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129479 Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com> Reviewed-by: Hossein <hossein@libreoffice.org> Tested-by: Jenkins
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/node.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 5306908cefbe..a13f5deada56 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -22,9 +22,9 @@
#include <smmod.hxx>
#include "tmpdevice.hxx"
#include <visitors.hxx>
-
#include <vcl/metric.hxx>
#include <osl/diagnose.h>
+#include <basegfx/numeric/ftools.hxx>
namespace {
@@ -988,8 +988,7 @@ void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize,
const Point &rDiagPoint, double fAngleDeg) const
{
- static const double fPi = 3.1415926535897932384626433;
- double fAngleRad = fAngleDeg / 180.0 * fPi;
+ double fAngleRad = basegfx::deg2rad(fAngleDeg);
tools::Long nRectLeft = GetItalicLeft(),
nRectRight = GetItalicRight(),
nRectTop = GetTop(),