summaryrefslogtreecommitdiff
path: root/basegfx/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-11-18 23:42:32 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-11-19 10:00:02 +0100
commit1cc6fca4927b9684b1f5acedee7b60c0c7518e25 (patch)
treed3ec824cbf0bd00b7a89f004509fbcea5dccf70c /basegfx/source
parent37429f2690a96491ad0e4fa2a04f2fa88a66da87 (diff)
Drop F_2PI
Change-Id: Ie98606607b2ce262e4eed76bb8cd86fbfe846f76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125506 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basegfx/source')
-rw-r--r--basegfx/source/matrix/b2dhommatrixtools.cxx2
-rw-r--r--basegfx/source/polygon/b2dlinegeometry.cxx4
-rw-r--r--basegfx/source/polygon/b2dpolygontools.cxx6
-rw-r--r--basegfx/source/polygon/b3dpolygontools.cxx4
-rw-r--r--basegfx/source/polygon/b3dpolypolygontools.cxx12
5 files changed, 14 insertions, 14 deletions
diff --git a/basegfx/source/matrix/b2dhommatrixtools.cxx b/basegfx/source/matrix/b2dhommatrixtools.cxx
index f621b8f879ad..50f4e36ab30b 100644
--- a/basegfx/source/matrix/b2dhommatrixtools.cxx
+++ b/basegfx/source/matrix/b2dhommatrixtools.cxx
@@ -30,7 +30,7 @@ namespace basegfx::utils
{
// determine quadrant
const sal_Int32 nQuad(
- (4 + fround( 4/F_2PI*fmod( fRadiant, F_2PI ) )) % 4 );
+ (4 + fround( M_2_PI*fmod( fRadiant, 2 * M_PI ) )) % 4 );
switch( nQuad )
{
case 0: // -2pi,0,2pi
diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx
index 03d73a8d3028..6dda8f9e7e1f 100644
--- a/basegfx/source/polygon/b2dlinegeometry.cxx
+++ b/basegfx/source/polygon/b2dlinegeometry.cxx
@@ -771,12 +771,12 @@ namespace basegfx
// atan2 results are [-PI .. PI], consolidate to [0.0 .. 2PI]
if(fAngleStart < 0.0)
{
- fAngleStart += F_2PI;
+ fAngleStart += 2 * M_PI;
}
if(fAngleEnd < 0.0)
{
- fAngleEnd += F_2PI;
+ fAngleEnd += 2 * M_PI;
}
const B2DPolygon aBow(utils::createPolygonFromEllipseSegment(rPoint, fHalfLineWidth, fHalfLineWidth, fAngleStart, fAngleEnd));
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index ce62a95c020f..d497716e9c31 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -1822,14 +1822,14 @@ namespace basegfx::utils
{
B2DPolygon aRetval;
- // truncate fStart, fEnd to a range of [0.0 .. F_2PI[ where F_2PI
+ // truncate fStart, fEnd to a range of [0.0 .. 2PI[ where 2PI
// falls back to 0.0 to ensure a unique definition
if(fTools::less(fStart, 0.0))
{
fStart = 0.0;
}
- if(fTools::moreOrEqual(fStart, F_2PI))
+ if(fTools::moreOrEqual(fStart, 2 * M_PI))
{
fStart = 0.0;
}
@@ -1839,7 +1839,7 @@ namespace basegfx::utils
fEnd = 0.0;
}
- if(fTools::moreOrEqual(fEnd, F_2PI))
+ if(fTools::moreOrEqual(fEnd, 2 * M_PI))
{
fEnd = 0.0;
}
diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx
index 708417122abf..a1f65bef2f48 100644
--- a/basegfx/source/polygon/b3dpolygontools.cxx
+++ b/basegfx/source/polygon/b3dpolygontools.cxx
@@ -401,7 +401,7 @@ namespace basegfx::utils
// transitions which value to choose
const B3DRange aPlaneRange(getRange(rCandidate));
const B3DPoint aPlaneCenter(aPlaneRange.getCenter() - rCenter);
- const double fXCenter(fOne - ((atan2(aPlaneCenter.getZ(), aPlaneCenter.getX()) + M_PI) / F_2PI));
+ const double fXCenter(fOne - ((atan2(aPlaneCenter.getZ(), aPlaneCenter.getX()) + M_PI) / (2 * M_PI)));
for(a = 0; a < nPointCount; a++)
{
@@ -438,7 +438,7 @@ namespace basegfx::utils
}
else
{
- double fX(fOne - ((atan2(aVector.getZ(), aVector.getX()) + M_PI) / F_2PI));
+ double fX(fOne - ((atan2(aVector.getZ(), aVector.getX()) + M_PI) / (2 * M_PI)));
// correct cartesian point coordinate dependent from center value
if(fX > fXCenter + 0.5)
diff --git a/basegfx/source/polygon/b3dpolypolygontools.cxx b/basegfx/source/polygon/b3dpolypolygontools.cxx
index 2c7b3c1fc5a3..62ddd3ae771f 100644
--- a/basegfx/source/polygon/b3dpolypolygontools.cxx
+++ b/basegfx/source/polygon/b3dpolypolygontools.cxx
@@ -200,7 +200,7 @@ namespace basegfx::utils
}
// helper for getting the 3D Point from given cartesian coordinates. fHor is defined from
- // [M_PI_2 .. -M_PI_2], fVer from [0.0 .. F_2PI]
+ // [M_PI_2 .. -M_PI_2], fVer from [0.0 .. 2PI]
static B3DPoint getPointFromCartesian(double fHor, double fVer)
{
const double fCosVer(cos(fVer));
@@ -217,7 +217,7 @@ namespace basegfx::utils
if(!nHorSeg)
{
- nHorSeg = fround(fabs(fHorStop - fHorStart) / (F_2PI / 24.0));
+ nHorSeg = fround(fabs(fHorStop - fHorStart) / (M_PI / 12.0));
}
// min/max limitations
@@ -225,7 +225,7 @@ namespace basegfx::utils
if(!nVerSeg)
{
- nVerSeg = fround(fabs(fVerStop - fVerStart) / (F_2PI / 24.0));
+ nVerSeg = fround(fabs(fVerStop - fVerStart) / (M_PI / 12.0));
}
// min/max limitations
@@ -234,7 +234,7 @@ namespace basegfx::utils
// create constants
const double fVerDiffPerStep((fVerStop - fVerStart) / static_cast<double>(nVerSeg));
const double fHorDiffPerStep((fHorStop - fHorStart) / static_cast<double>(nHorSeg));
- bool bHorClosed(fTools::equal(fHorStop - fHorStart, F_2PI));
+ bool bHorClosed(fTools::equal(fHorStop - fHorStart, 2 * M_PI));
bool bVerFromTop(fTools::equal(fVerStart, M_PI_2));
bool bVerToBottom(fTools::equal(fVerStop, -M_PI_2));
@@ -316,7 +316,7 @@ namespace basegfx::utils
if(!nHorSeg)
{
- nHorSeg = fround(fabs(fHorStop - fHorStart) / (F_2PI / 24.0));
+ nHorSeg = fround(fabs(fHorStop - fHorStart) / (M_PI / 12.0));
}
// min/max limitations
@@ -324,7 +324,7 @@ namespace basegfx::utils
if(!nVerSeg)
{
- nVerSeg = fround(fabs(fVerStop - fVerStart) / (F_2PI / 24.0));
+ nVerSeg = fround(fabs(fVerStop - fVerStart) / (M_PI / 12.0));
}
// min/max limitations