summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgregory guy <[email protected]>2020-05-22 12:41:39 +0200
committerSlávek Banko <[email protected]>2020-05-26 15:02:34 +0200
commit78178b45c79a3fb909e9214664dc7dc1c577bed9 (patch)
treed50efb3084b31a063a846dceaef59a81c4ca4fdc /src
parent6b59b0be7f885d4951f3533c0dbbfc489beb566f (diff)
downloadkscope-78178b45c79a3fb909e9214664dc7dc1c577bed9.tar.gz
kscope-78178b45c79a3fb909e9214664dc7dc1c577bed9.zip
Use PI's value from the C lib.
Signed-off-by: gregory guy <[email protected]> (cherry picked from commit 8bc51aef53e4d9de236ca4f19806b32da1cc0525)
Diffstat (limited to 'src')
-rw-r--r--src/graphwidget.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/graphwidget.cpp b/src/graphwidget.cpp
index c412520..b2911c0 100644
--- a/src/graphwidget.cpp
+++ b/src/graphwidget.cpp
@@ -543,9 +543,9 @@ void GraphWidget::drawEdge(const TQString& sCaller, const TQString& sCallee,
// Draw the edge
pEdge->show();
}
-
-#define PI 3.14159265
-
+#ifndef M_PI
+#define M_PI 3.14159265
+#endif
/**
* Sets and computes values used for drawing arrows.
* Initialises the static ArroInfo structure, which is passed in drawEdge().
@@ -558,7 +558,7 @@ void GraphWidget::setArrowInfo(int nLength, int nDegrees)
double dRad;
// Turn degrees into radians
- dRad = ((double)nDegrees) * PI / 180.0;
+ dRad = ((double)nDegrees) * M_PI / 180.0;
s_ai.m_dLength = (double)nLength;
s_ai.m_dTan = tan(dRad);