summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-11-18 17:43:46 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-11-19 09:59:43 +0100
commit37429f2690a96491ad0e4fa2a04f2fa88a66da87 (patch)
tree9963c1f531f22306edaf2ce8b41d5636f5e191f3 /drawinglayer
parent0afd2d3bfa9d55249ffd1408681ff04decf2d8fa (diff)
Use M_PI* instead of F_PI*
Change-Id: Ie2b7a1c74fc516781a17a20157b8217bc41e383d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125504 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx4
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx2
-rw-r--r--drawinglayer/source/primitive2d/textprimitive2d.cxx2
-rw-r--r--drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx4
-rw-r--r--drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx18
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx2
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx2
-rw-r--r--drawinglayer/source/texture/texture3d.cxx4
8 files changed, 19 insertions, 19 deletions
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
index b01f8d76222a..49b26cb919b0 100644
--- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
@@ -65,7 +65,7 @@ namespace drawinglayer::primitive2d
getDefinitionRange(),
getOutputRange(),
fDistance,
- fAngle - F_PI4);
+ fAngle - M_PI_4);
aHatch.appendTransformations(aMatrices);
@@ -78,7 +78,7 @@ namespace drawinglayer::primitive2d
getDefinitionRange(),
getOutputRange(),
fDistance,
- fAngle - F_PI2);
+ fAngle - M_PI_2);
aHatch.appendTransformations(aMatrices);
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 38a14e927005..a6e209a577c6 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -395,7 +395,7 @@ vcl::Font getVclFontFromFontAttribute(const attribute::FontAttribute& rFontAttri
// handle FontRotation (if defined)
if (!basegfx::fTools::equalZero(fFontRotation))
{
- sal_Int16 aRotate10th(static_cast<sal_Int16>(fFontRotation * (-1800.0 / F_PI)));
+ sal_Int16 aRotate10th(static_cast<sal_Int16>(fFontRotation * (-1800.0 / M_PI)));
aRetval.SetOrientation(Degree10(aRotate10th % 3600));
}
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index b86e7acc20e7..4e584f2b6e92 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -101,7 +101,7 @@ void TextSimplePortionPrimitive2D::getTextOutlinesAndTransformation(
if (basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0))
{
aScale = basegfx::absolute(aScale);
- fRotate += F_PI;
+ fRotate += M_PI;
}
// for the TextLayouterDevice, it is necessary to have a scaling representing
diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
index 59098d3cd3ef..a699f71706bb 100644
--- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
@@ -142,7 +142,7 @@ namespace drawinglayer::primitive3d
aOutlineRange,
aOutlineRange,
getHatch().getDistance(),
- fAngle - F_PI4);
+ fAngle - M_PI_4);
aHatch.appendTransformations(aMatrices);
@@ -155,7 +155,7 @@ namespace drawinglayer::primitive3d
aOutlineRange,
aOutlineRange,
getHatch().getDistance(),
- fAngle - F_PI2);
+ fAngle - M_PI_2);
aHatch.appendTransformations(aMatrices);
diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
index 8065ad73e54f..50aae077d2ba 100644
--- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
@@ -234,7 +234,7 @@ namespace drawinglayer::primitive3d
nSegments,
nVerSeg,
true,
- F_PI2, 0.0,
+ M_PI_2, 0.0,
0.0, F_2PI));
const sal_uInt32 nCount(aSphere.count());
@@ -244,7 +244,7 @@ namespace drawinglayer::primitive3d
// forget to transform normals, too
basegfx::B3DHomMatrix aSphereTrans;
- aSphereTrans.rotate(0.0, 0.0, F_PI2);
+ aSphereTrans.rotate(0.0, 0.0, M_PI_2);
aSphere.transform(aSphereTrans);
aSphere.transformNormals(aSphereTrans);
@@ -301,7 +301,7 @@ namespace drawinglayer::primitive3d
if(nHorSeg)
{
// create half-sphere
- const basegfx::B3DPolyPolygon aSphere(basegfx::utils::createUnitSphereFillPolyPolygon(nHorSeg, nVerSeg, true, F_PI2, -F_PI2, 0.0, fAngle));
+ const basegfx::B3DPolyPolygon aSphere(basegfx::utils::createUnitSphereFillPolyPolygon(nHorSeg, nVerSeg, true, M_PI_2, -M_PI_2, 0.0, fAngle));
for(sal_uInt32 a(0); a < aSphere.count(); a++)
{
@@ -331,13 +331,13 @@ namespace drawinglayer::primitive3d
}
}
- const double fInc(F_PI / static_cast<double>(nVerSeg));
+ const double fInc(M_PI / static_cast<double>(nVerSeg));
const double fSin(sin(-fAngle));
const double fCos(cos(-fAngle));
const bool bMiter(basegfx::B2DLineJoin::Miter == aLineJoin);
const double fMiterSin(bMiter ? sin(-(fAngle/2.0)) : 0.0);
const double fMiterCos(bMiter ? cos(-(fAngle/2.0)) : 0.0);
- double fPos(-F_PI2);
+ double fPos(-M_PI_2);
basegfx::B3DPoint aPointOnXY, aPointRotY, aNextPointOnXY, aNextPointRotY;
basegfx::B3DPoint aCurrMiter, aNextMiter;
basegfx::B3DPolygon aNewPolygon, aMiterPolygon;
@@ -611,7 +611,7 @@ using namespace com::sun::star;
if(!basegfx::fTools::equalZero(fCross))
{
// line connect non-parallel, aBack, aForw, use getLineJoin()
- const double fAngle(acos(aBack.scalar(aForw) / (fForwLen * aBack.getLength()))); // 0.0 .. F_PI2
+ const double fAngle(acos(aBack.scalar(aForw) / (fForwLen * aBack.getLength()))); // 0.0 .. M_PI_2
Primitive3DContainer aNewList(
getLineJoinSegments(
nSegments,
@@ -629,8 +629,8 @@ using namespace com::sun::star;
// create trans by rotating unit sphere with angle 90 degrees around Y, then 180-fRot in X.
// Also apply usual scaling and translation
basegfx::B3DHomMatrix aSphereTrans;
- aSphereTrans.rotate(0.0, F_PI2, 0.0);
- aSphereTrans.rotate(F_PI - fRotInYZ, 0.0, 0.0);
+ aSphereTrans.rotate(0.0, M_PI_2, 0.0);
+ aSphereTrans.rotate(M_PI - fRotInYZ, 0.0, 0.0);
aSphereTrans *= aRotVector;
aSphereTrans.scale(getRadius(), getRadius(), getRadius());
aSphereTrans.translate(aCurr.getX(), aCurr.getY(), aCurr.getZ());
@@ -655,7 +655,7 @@ using namespace com::sun::star;
basegfx::B3DHomMatrix aBackCapTrans;
// Mirror (line end) and radius scale
- aBackCapTrans.rotate(0.0, F_PI, 0.0);
+ aBackCapTrans.rotate(0.0, M_PI, 0.0);
aBackCapTrans.scale(getRadius(), getRadius(), getRadius());
if(bLineCapSquare && bLast)
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
index 10ba09e41b07..919fbcf5ab4a 100644
--- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
@@ -234,7 +234,7 @@ namespace drawinglayer::primitive3d
// take each angle which deviates more than 10% from going straight as
// special edge. This will detect the two outer edges of pie segments,
// but not always the center one (think about a near 180 degree pie)
- if(F_PI - fabs(fAngle) > F_PI * 0.1)
+ if(M_PI - fabs(fAngle) > M_PI * 0.1)
{
if(nPointCount == nIndexA)
{
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index b055ef229ce2..5d3f68d29a4a 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -119,7 +119,7 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
// be expressed as rotation by PI. Use this since the Font rendering will not
// apply the negative scales in any form
aFontScaling = basegfx::absolute(aFontScaling);
- fRotate += F_PI;
+ fRotate += M_PI;
}
if (basegfx::fTools::more(aFontScaling.getX(), 0.0)
diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx
index 4d5df6e52e60..0a83937991d2 100644
--- a/drawinglayer/source/texture/texture3d.cxx
+++ b/drawinglayer/source/texture/texture3d.cxx
@@ -285,7 +285,7 @@ namespace drawinglayer::texture
aOutlineRange,
aOutlineRange,
rHatch.getDistance(),
- fAngleA + F_PI2) );
+ fAngleA + M_PI_2) );
}
if(attribute::HatchStyle::Triple == rHatch.getStyle())
@@ -294,7 +294,7 @@ namespace drawinglayer::texture
aOutlineRange,
aOutlineRange,
rHatch.getDistance(),
- fAngleA + F_PI4) );
+ fAngleA + M_PI_4) );
}
}