diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-18 23:42:32 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-19 10:00:02 +0100 |
commit | 1cc6fca4927b9684b1f5acedee7b60c0c7518e25 (patch) | |
tree | d3ec824cbf0bd00b7a89f004509fbcea5dccf70c | |
parent | 37429f2690a96491ad0e4fa2a04f2fa88a66da87 (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>
24 files changed, 53 insertions, 56 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 diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx index 50aae077d2ba..d8d3cc9c8b3e 100644 --- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx @@ -69,7 +69,7 @@ namespace drawinglayer::primitive3d basegfx::B3DPoint aLastLeft(0.0, 1.0, 0.0); basegfx::B3DPoint aLastRight(1.0, 1.0, 0.0); basegfx::B3DHomMatrix aRot; - aRot.rotate(F_2PI / static_cast<double>(m_nLineTubeSegments), 0.0, 0.0); + aRot.rotate(2 * M_PI / static_cast<double>(m_nLineTubeSegments), 0.0, 0.0); m_aLineTubeList.resize(m_nLineTubeSegments); for(sal_uInt32 a = 0; a < m_nLineTubeSegments; ++a) @@ -148,7 +148,7 @@ namespace drawinglayer::primitive3d const basegfx::B3DPoint aNull(0.0, 0.0, 0.0); basegfx::B3DPoint aLast(0.0, 1.0, 0.0); basegfx::B3DHomMatrix aRot; - aRot.rotate(F_2PI / static_cast<double>(m_nLineCapSegments), 0.0, 0.0); + aRot.rotate(2 * M_PI / static_cast<double>(m_nLineCapSegments), 0.0, 0.0); m_aLineCapList.resize(m_nLineCapSegments); for(sal_uInt32 a = 0; a < m_nLineCapSegments; ++a) @@ -235,7 +235,7 @@ namespace drawinglayer::primitive3d nVerSeg, true, M_PI_2, 0.0, - 0.0, F_2PI)); + 0.0, 2 * M_PI)); const sal_uInt32 nCount(aSphere.count()); if (nCount) @@ -296,7 +296,7 @@ namespace drawinglayer::primitive3d if(basegfx::B2DLineJoin::Round == aLineJoin) { // calculate new horizontal segments - const sal_uInt32 nHorSeg(basegfx::fround((fAngle / F_2PI) * static_cast<double>(nSegments))); + const sal_uInt32 nHorSeg(basegfx::fround((fAngle / (2 * M_PI)) * static_cast<double>(nSegments))); if(nHorSeg) { diff --git a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx index afe030ac77b9..2993b1dd27c3 100644 --- a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx +++ b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx @@ -360,7 +360,7 @@ namespace drawinglayer::primitive3d else { const bool bBackScale(!basegfx::fTools::equal(fBackScale, 1.0)); - const bool bClosedRotation(!bBackScale && basegfx::fTools::equal(fRotation, F_2PI)); + const bool bClosedRotation(!bBackScale && basegfx::fTools::equal(fRotation, 2 * M_PI)); basegfx::B2DPolyPolygon aFront(rSource); basegfx::B2DPolyPolygon aBack(rSource); basegfx::B3DHomMatrix aTransformBack; diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx index e490631c55f3..2115ebc3abe7 100644 --- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx @@ -43,7 +43,7 @@ namespace drawinglayer::primitive3d if(!rSliceVector.empty()) { const bool bBackScale(!basegfx::fTools::equal(getBackScale(), 1.0)); - const bool bClosedRotation(!bBackScale && getHorizontalSegments() && basegfx::fTools::equal(getRotation(), F_2PI)); + const bool bClosedRotation(!bBackScale && getHorizontalSegments() && basegfx::fTools::equal(getRotation(), 2 * M_PI)); sal_uInt32 a; // decide what to create diff --git a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx index 1e0dd7454124..c3127261f502 100644 --- a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx @@ -83,7 +83,7 @@ namespace drawinglayer::primitive3d // different from forced to sphere texture coordinates, // create a old version from it by rotating to old state before applying // the texture coordinates to emulate old behaviour - fRelativeAngle = F_2PI * (static_cast<double>((getHorizontalSegments() >> 1) - 1) / static_cast<double>(getHorizontalSegments())); + fRelativeAngle = 2 * M_PI * (static_cast<double>((getHorizontalSegments() >> 1) - 1) / static_cast<double>(getHorizontalSegments())); basegfx::B3DHomMatrix aRot; aRot.rotate(0.0, fRelativeAngle, 0.0); aFill.transform(aRot); diff --git a/include/basegfx/numeric/ftools.hxx b/include/basegfx/numeric/ftools.hxx index 7045695bf5fb..63e7a0d460ce 100644 --- a/include/basegfx/numeric/ftools.hxx +++ b/include/basegfx/numeric/ftools.hxx @@ -33,9 +33,6 @@ #ifndef F_PI18000 #define F_PI18000 (M_PI/18000.0) #endif -#ifndef F_2PI -#define F_2PI (2.0*M_PI) -#endif // fTools defines diff --git a/include/basegfx/polygon/b3dpolypolygontools.hxx b/include/basegfx/polygon/b3dpolypolygontools.hxx index 4480f3266704..8346ba5d8fdc 100644 --- a/include/basegfx/polygon/b3dpolypolygontools.hxx +++ b/include/basegfx/polygon/b3dpolypolygontools.hxx @@ -62,7 +62,7 @@ namespace basegfx::utils BASEGFX_DLLPUBLIC B3DPolyPolygon createUnitSpherePolyPolygon( sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, double fVerStart = M_PI_2, double fVerStop = -M_PI_2, - double fHorStart = 0.0, double fHorStop = F_2PI); + double fHorStart = 0.0, double fHorStop = 2 * M_PI); /** Create a 3D line polyPolygon from a B3DRange which defines a sphere with the given count of hor and ver segments. If nHorSeg == 0 and/or nVerSeg == 0, a default will be calculated to have a step at least each 15 degrees. @@ -72,7 +72,7 @@ namespace basegfx::utils const B3DRange& rRange, sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, double fVerStart = M_PI_2, double fVerStop = -M_PI_2, - double fHorStart = 0.0, double fHorStop = F_2PI); + double fHorStart = 0.0, double fHorStop = 2 * M_PI); /** same as createUnitSpherePolyPolygon, but creates filled polygons (closed and oriented) There is one extra, the bool bNormals defines if normals will be set, default is false @@ -81,7 +81,7 @@ namespace basegfx::utils sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, bool bNormals = false, double fVerStart = M_PI_2, double fVerStop = -M_PI_2, - double fHorStart = 0.0, double fHorStop = F_2PI); + double fHorStart = 0.0, double fHorStop = 2 * M_PI); /** same as createSpherePolyPolygonFromB3DRange, but creates filled polygons (closed and oriented) There is one extra, the bool bNormals defines if normals will be set, default is false @@ -91,7 +91,7 @@ namespace basegfx::utils sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, bool bNormals = false, double fVerStart = M_PI_2, double fVerStop = -M_PI_2, - double fHorStart = 0.0, double fHorStop = F_2PI); + double fHorStart = 0.0, double fHorStop = 2 * M_PI); /** Create/replace normals for given 3d geometry with default normals from given center to outside. rCandidate: the 3d geometry to change diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 2fb4df76bd1e..1f05a3782a7c 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -2008,7 +2008,7 @@ static double lcl_getNormalizedCircleAngleRad(const double fWR, const double fHR { fRet = atan2(fY, fX); if (fRet < 0.0) - fRet += F_2PI; + fRet += 2 * M_PI; } return fRet; } @@ -2494,7 +2494,7 @@ void EnhancedCustomShape2d::CreateSubPath( } else // right, down { - aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*M_PI, F_2PI); + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*M_PI, 2*M_PI); } } } @@ -2505,7 +2505,7 @@ void EnhancedCustomShape2d::CreateSubPath( { if (aEnd.getY()<aStart.getY()) // up, left { - aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*M_PI, F_2PI); + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*M_PI, 2*M_PI); aArc.flip(); } else // down, left diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 504e65e6c7a6..3f55e04425f4 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -314,7 +314,7 @@ void Svx3DLightControl::Construct2() a2DHalfCircle.append(basegfx::B2DPoint(RADIUS_LAMP_PREVIEW_SIZE, 0.0)); a2DHalfCircle.append(basegfx::B2DPoint(RADIUS_LAMP_PREVIEW_SIZE, -RADIUS_LAMP_PREVIEW_SIZE)); a2DHalfCircle.append(basegfx::utils::createPolygonFromEllipseSegment( - basegfx::B2DPoint(0.0, 0.0), RADIUS_LAMP_PREVIEW_SIZE, RADIUS_LAMP_PREVIEW_SIZE, F_2PI - M_PI_2, M_PI_2)); + basegfx::B2DPoint(0.0, 0.0), RADIUS_LAMP_PREVIEW_SIZE, RADIUS_LAMP_PREVIEW_SIZE, 2 * M_PI - M_PI_2, M_PI_2)); basegfx::B3DPolygon a3DHalfCircle(basegfx::utils::createB3DPolygonFromB2DPolygon(a2DHalfCircle)); // create object for it @@ -600,12 +600,12 @@ bool Svx3DLightControl::MouseMove(const MouseEvent& rMEvt) // cut horizontal while(fNewRotY < 0.0) { - fNewRotY += F_2PI; + fNewRotY += 2 * M_PI; } - while(fNewRotY >= F_2PI) + while(fNewRotY >= 2 * M_PI) { - fNewRotY -= F_2PI; + fNewRotY -= 2 * M_PI; } // cut vertical diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx index 32ad5764db7e..d96d640a70cc 100644 --- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx @@ -105,7 +105,7 @@ namespace drawinglayer::primitive2d if(getTextAutoAngle() && fTestAngle < -M_PI) { - fTestAngle += F_2PI; + fTestAngle += 2 * M_PI; } } diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 54889a9dde28..85d4a721a066 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -710,7 +710,7 @@ void handleNegativeScale(basegfx::B2DTuple & scale, double * rotate) { { scale.setX(fabs(scale.getX())); scale.setY(fabs(scale.getY())); - *rotate = fmod(*rotate + M_PI, F_2PI); + *rotate = fmod(*rotate + M_PI, 2 * M_PI); } } diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 17cf7f4a431e..efeefc79dcea 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -2907,7 +2907,7 @@ void SdrPathObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b { aScale.setX(fabs(aScale.getX())); aScale.setY(fabs(aScale.getY())); - fRotate = fmod(fRotate + M_PI, F_2PI); + fRotate = fmod(fRotate + M_PI, 2 * M_PI); } // copy poly diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 8886ce464ca3..958033d0d6a3 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -641,7 +641,7 @@ double SwNoTextFrame::getLocalFrameRotation() const const SwRotationGrf& rSwRotationGrf(rSwAttrSet.GetRotationGrf()); const double fRotate = -toRadians(rSwRotationGrf.GetValue()); - return basegfx::normalizeToRange(fRotate, F_2PI); + return basegfx::normalizeToRange(fRotate, 2 * M_PI); } } @@ -1440,7 +1440,7 @@ bool SwNoTextFrame::IsTransparent() const if(isTransformableSwFrame()) { // we can be more specific - rotations of multiples of - // 90 degrees will leave no gaps. Go from [0.0 .. F_2PI] + // 90 degrees will leave no gaps. Go from [0.0 .. 2PI] // to [0 .. 360] and check modulo 90 const tools::Long nRot(static_cast<tools::Long>(basegfx::rad2deg(getLocalFrameRotation()))); const bool bMultipleOf90(0 == (nRot % 90)); diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 8be16bbd5ebd..6a9aff2be250 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -272,10 +272,10 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rBound, const Point& rStart, c sal_uInt16 nEnd; // #i73608# If startPoint is equal to endPoint, then draw full circle instead of nothing (as Metafiles spec) if( fDiff <= 0. ) - fDiff += F_2PI; + fDiff += 2 * M_PI; // Proportionally shrink number of points( fDiff / (2PI) ); - nPoints = std::max( static_cast<sal_uInt16>( ( fDiff / F_2PI ) * nPoints ), sal_uInt16(16) ); + nPoints = std::max( static_cast<sal_uInt16>( ( fDiff / (2 * M_PI) ) * nPoints ), sal_uInt16(16) ); fStep = fDiff / ( nPoints - 1 ); if( PolyStyle::Pie == eStyle ) diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index d2c52c47a746..5a0502babba2 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -727,10 +727,10 @@ namespace return true; } - fRotate = fmod( fRotate, F_2PI ); + fRotate = fmod( fRotate, 2 * M_PI ); if (fRotate < 0) { - fRotate += F_2PI; + fRotate += 2 * M_PI; } if (!rtl::math::approxEqual(fRotate, 0) && !rtl::math::approxEqual(fRotate, M_PI_2) diff --git a/vcl/source/filter/ipict/shape.cxx b/vcl/source/filter/ipict/shape.cxx index 79643123639c..88a62cfd2ff2 100644 --- a/vcl/source/filter/ipict/shape.cxx +++ b/vcl/source/filter/ipict/shape.cxx @@ -171,17 +171,17 @@ namespace PictReaderShape { tools::Long const Y[2] = { arc.Top(), arc.Bottom() }; B2DPoint center(0.5*(X[1]+X[0]), 0.5*(Y[1]+Y[0])); - // We must have angl1 between 0 and F_2PI - while (angl1 < 0.0) { angl1 += F_2PI; angl2 += F_2PI; } - while (angl1 >= F_2PI) { angl1 -= F_2PI; angl2 -= F_2PI; } + // We must have angl1 between 0 and 2PI + while (angl1 < 0.0) { angl1 += 2 * M_PI; angl2 += 2 * M_PI; } + while (angl1 >= 2 * M_PI) { angl1 -= 2 * M_PI; angl2 -= 2 * M_PI; } // if this happen, we want a complete circle // so we set angl2 slightly less than angl1 - if (angl2 >= angl1+F_2PI) angl2 = angl1-0.001; + if (angl2 >= angl1 + 2 * M_PI) angl2 = angl1-0.001; - // We must have angl2 between 0 and F_2PI - while (angl2 < 0.0) angl2 += F_2PI; - while (angl2 >= F_2PI) angl2 -= F_2PI; + // We must have angl2 between 0 and 2PI + while (angl2 < 0.0) angl2 += 2 * M_PI; + while (angl2 >= 2 * M_PI) angl2 -= 2 * M_PI; B2DPolygon poly = basegfx::utils::createPolygonFromEllipseSegment(center, 0.5*(X[1]-X[0]), 0.5*(Y[1]-Y[0]), angl1, angl2); if (drawFrame) diff --git a/vcl/source/outdev/bitmapex.cxx b/vcl/source/outdev/bitmapex.cxx index cfa0512e9e4b..44170e633bfe 100644 --- a/vcl/source/outdev/bitmapex.cxx +++ b/vcl/source/outdev/bitmapex.cxx @@ -660,10 +660,10 @@ void OutputDevice::DrawTransformedBitmapEx( else { // Just rotation, can do that directly. - fFullRotate = fmod(fFullRotate * -1, F_2PI); + fFullRotate = fmod(fFullRotate * -1, 2 * M_PI); if (fFullRotate < 0) { - fFullRotate += F_2PI; + fFullRotate += 2 * M_PI; } Degree10 nAngle10(basegfx::fround(basegfx::rad2deg(fFullRotate) * 10)); aTransformed.Rotate(nAngle10, COL_TRANSPARENT); diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx index 74e3d6f55c37..7a31f981a371 100644 --- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx +++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx @@ -420,7 +420,7 @@ FreetypeFont::FreetypeFont(FreetypeFontInstance& rFontInstance, const std::share if( rFSD.mnOrientation ) { - const double dRad = rFSD.mnOrientation.get() * ( F_2PI / 3600.0 ); + const double dRad = rFSD.mnOrientation.get() * ( 2 * M_PI / 3600.0 ); mnCos = static_cast<tools::Long>( 0x10000 * cos( dRad ) + 0.5 ); mnSin = static_cast<tools::Long>( 0x10000 * sin( dRad ) + 0.5 ); } diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 372a96d3126f..a89857c099a7 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -1260,7 +1260,7 @@ public: break; default: aTransform.translate(-aSize.Width()/2, -aSize.Height()/2); - aTransform.rotate(2 * F_2PI * i / nToRender); + aTransform.rotate(2 * 2 * M_PI * i / nToRender); aTransform.translate(aSize.Width()/2, aSize.Height()/2); break; } diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 322a5e2128e3..b3a26d955ee2 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -3087,7 +3087,7 @@ void XMLTextParagraphExport::_exportTextGraphic( // add rotation itself // tdf#115529 but correct value modulo 2PI to have it positive and in the range of [0.0 .. 2PI[ - aSdXMLImExTransform2D.AddRotate(basegfx::normalizeToRange(fRotate, F_2PI)); + aSdXMLImExTransform2D.AddRotate(basegfx::normalizeToRange(fRotate, 2 * M_PI)); // back-transform after rotation aSdXMLImExTransform2D.AddTranslate(aCenter); |